www.webdeveloper.com
Results 1 to 3 of 3

Thread: checkbox problem in php

  1. #1
    Join Date
    Nov 2005
    Posts
    183

    checkbox problem in php

    hi all,

    i facing a problem getting the checkboxes values in an html from using php,

    im declaring the checkboxes this way

    HTML Code:
    <input type="checkbox" name="age_range[]" value="1-6">1-6
          	<input type="checkbox" name="age_range[]" value="7-14">7-14 
          	<input type="checkbox" name="age_range[]" value="15-19">15-19  
          	<input type="checkbox" name="age_range[]" value="20-25">20-25
          	<input type="checkbox" name="age_range[]" value="26-30">26-30
          	<input type="checkbox" name="age_range[]" value="Above 30">Above 30
    and processing it using php this way

    PHP Code:
    $model_ages $_POST['age_range'];
       
       foreach (
    $model_ages as $ages
       {
         echo 
    $ages ."<br />";
       } 
    when i submit the form i get the values
    on
    on
    on
    on

    any idea why

    Thank you


    Noor
    لبنان يا بلد صغير بالقلب كبير



  2. #2
    Join Date
    Nov 2005
    Posts
    183
    got it guys,

    gotta use id instead of name, dunno why but it works
    لبنان يا بلد صغير بالقلب كبير



  3. #3
    Join Date
    Nov 2005
    Posts
    183
    stopped working again

    i dunno what's wrong with it ??
    لبنان يا بلد صغير بالقلب كبير



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles