#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    60
    Rep Power
    15
    Is there a way to have a form with let's say 10 checkboxes all named "Products"... then I'd like a variable come out with each one that's checked, separated by a comma (like FormMail): product1, product32, etc...?

    Thanks!
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    terium,

    use your check box as an array..

    <input type="checkbox" name="Products[]" value="one">
    <input type="checkbox" name="Products[]" value="two">
    <input type="checkbox" name="Products[]" value="three">

    ------
    Get this check box values in your php like..

    <?
    $count=count($Products[]);

    for($a=0;$a<$count;$a++){
    echo $Products[$a];
    }
    ?>

    ------------------

    if you want put a comma in between then use..

    <?
    $values=implode(',',$Products);
    echo $values;
    ?>

    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited July 16, 2000).]

Similar Threads

  1. Help with checkboxes
    By PRETTYfromDAWGS in forum PHP Development
    Replies: 1
    Last Post: September 26th, 2003, 07:09 AM
  2. validating cascading checkboxes
    By kishored in forum Java Help
    Replies: 3
    Last Post: July 30th, 2003, 01:22 PM
  3. Forms and checkboxes
    By dante2010 in forum PHP Development
    Replies: 3
    Last Post: September 3rd, 2002, 01:59 PM
  4. Replies: 2
    Last Post: February 25th, 2002, 11:10 AM
  5. select all checkboxes
    By homerdooh in forum HTML Programming
    Replies: 5
    Last Post: January 29th, 2002, 04:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo