Posted by Leszek on 02/02/06 00:22
I've got a form with a select list:
<select name="$dane[$idhotelu][$pomocnicza][$k]">;
After "submit"
$_POST['$dane'][$idhotelu][$pomocnicza][$k] contains the selected value -
Am I right??
I have a problem ith this code:
echo"<select name=\"\$dane[$idhotelu][$pomocnicza][$k]\">";
for($i=0;$i<=$nrooms;$i++)
{
echo "<option value=\"$i\"";
if($POST['$dane'][$idhotelu][$pomocnicza][$k]==$i){
echo" selected>$i</option>\n";
}
else {
echo">$i</option>\n";
}//endif
}//endfor
echo"</select>";
Even if I do something like this:
$dane[1][$pomocnicza][0]=1
This seems to be true for $i=0:
if($POST['$dane'][1][$pomocnicza][0]==$i){
"if" condition is true for $i=0 I have no idea why...
Is it because after submit form is reloaded?
What i wanted to get is that if user select "1" from dropdown list then
after reloading this form "1" will be selected value...
Thank for any ideas.
Leszek
Navigation:
[Reply to this message]
|