|
|
#1 (permalink) |
|
Diamond Member
![]() Join Date: May 2005
Location: here
Age: 22
Posts: 1,017
|
Hello all,
I'd multiple checkboxs and radio buttons , and they are generated automatically based on the database that I'd (mysql).. on my page, I had queried all the questions and number of options, part of the code that I think you need is: for($i=1;$i<=$NbOptions;$i++) { if($MultiAnswer == 'yes') { echo "<input type='checkbox' name='box[]' value='$idQuestion_$i' />" . $row2['option'.$i]; echo "<br />"; } else { echo "<input type='radio' name='box[]' value='' />" . $row2['option'.$i]; echo "<br />"; } } when I press save , I use if(isset($_POST['save'])) //here I want to loop through all the box[]? and see if its checked or no
__________________
TechNoloGy ConTrols tHe World AnD I conTroL the TecHnOl0gy Gue$s WhO @m i. HehEhehee :confused: |
|
|
|
|
|
#2 (permalink) |
|
Moderator
![]() Join Date: Dec 2004
Location: Canada
Age: 25
Posts: 10,115
|
So you are looking for how to loop though it?
I think you'd want to do something like this: Code:
for ($i = 0; $i < count($_POST['box']; $i++){
if (isset($_POST['box'][$i])){
//do stuff
}
}
__________________
You know what the chain of command is? It's the chain I go get and beat you with 'til ya understand who's in ruttin' command here. I must plug a couple comics because they are good :D: www.ctrlaltdel-online.com www.userfriendly.org |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Renaming multiple files in windows explorer | PC Hobbyist | General Software | 5 | 02-06-2007 12:45 PM |
| Multiple problems with multiple games?!?!? | audiobahn1000 | General Software | 3 | 08-21-2006 12:07 PM |
| Multiple problems with multiple games?!?! | audiobahn1000 | General Software | 0 | 08-21-2006 09:22 AM |
| Multiple problems with multiple games?!?! | audiobahn1000 | General Software | 0 | 08-21-2006 09:21 AM |
| Multiple image resizing software | tobywuk | General Software | 1 | 06-18-2006 08:25 PM |