multiple option in checkbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hbhaskar
    New Member
    • Feb 2011
    • 3

    multiple option in checkbox

    for passing on multiple values through a variable, i used the following command within a form

    Code:
    $query = "SELECT * FROM case_query where case_no='$case_no'";
    $result = mysql_query($query);
    while($row = mysql_fetch_array($result))
    {
    extract($row);
    // queue_owner and query_id are the fields in table case_query
     echo "<tr><td ><input type='checkbox' name='C1'  value='$queue_owner'></td><td >$query_id</td><td>$queue_owner</td><td><input type='text'  name='reference'></td></tr>";
    }
    now When i submit and check 2 boxes (say)....i get only d values for last box....also value by the name "reference" comes blank
    can u help?
    Last edited by Dormilich; Mar 5 '11, 10:00 AM. Reason: please use [CODE] [/CODE] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    now When i submit and check 2 boxes (say)....i get only d values for last box
    of course you do, the last one overrides the previous ones if the have the same name. you can create an array by using [] in the name: <input name="exampe[]">


    also value by the name "reference" comes blank
    if there is no text put into the field, of course.

    Comment

    Working...