SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with "SELECT ALL" box

    I'm trying to pass an array with a form:
    Code:
    print "<tr class='mainrow'><td><INPUT type=checkbox name='mail[]' value=\"Check All\" onClick=\"this.value=check(this.form.mail());\">All</td><td colspan='8'>Select/Unselect all</td></tr>";
    Its giving me a syntax error

    The php form element is like this:

    Code:
    <input type='checkbox' name='mail[]' value='$address'>
    It works if I'm trying to pass a single variable, just messes up when I try to pass an array.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't you intend
    Code:
    check(this.form.mail())
    to be
    Code:
    check(this.form.mail[])
    which won't work and should be changed to
    Code:
    check(this.form.elements['mail[]'])
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome, thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •