How to remember a selection?
Posted: Thu Jan 27, 2005 12:00 pm
Hello guys and gals
Before I ask my question I want to say I am a php noob.
Okay, here is my problem:
I have 2 forms, form #1 contains the model selections, and form #2 contains view mode selections.
How to remember the choice made on the initial form, when selecting and reloading the following form?
I searched quite a bit on this matter, but the only thing I found was about how to remember the selection made, but with incremental numbers as selection.
Example:
Somewhat an easy code, but I am witnessing the code, thus I understand it. But for my problem, I can't get an idea how to start the code; I need to do like the code above, except not with numbers, with individual text, which I presume will have a variable for each selection, and then what?
Any help is immense, thx!
Ice9
Before I ask my question I want to say I am a php noob.
Okay, here is my problem:
I have 2 forms, form #1 contains the model selections, and form #2 contains view mode selections.
How to remember the choice made on the initial form, when selecting and reloading the following form?
I searched quite a bit on this matter, but the only thing I found was about how to remember the selection made, but with incremental numbers as selection.
Example:
Code: Select all
<?php
$sel = 1;
$qty = 6;
echo '<select name="selmod">';
while($sel <= $qty) {
if($sel == $_POSTї'selmod']) {
echo "<option value='$sel' selected>$sel</option>";
} else {
echo "<option value='$sel'>$sel</option>";
}
$sel++;
}
echo '</select>';
?>Any help is immense, thx!
Ice9