Posted by Jim Michaels on 02/12/06 08:15
"Leszek" <leszekt80@poczta.onet.pl> wrote in message
news:drrcd0$pm3$1@news.onet.pl...
> 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]\">";
get rid of the whole array thing and try using test[] instead. That is what
I have seen done before. I haven't seen any documentation that shows what
the behavior is for multidimensional arrays on a form element. only
suggestion in documentation is to use name[].
>
> for($i=0;$i<=$nrooms;$i++)
haven't I seen this one before? shouldn't that be < instead of <= ?
> {
> 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
>
>
>
[Back to original message]
|