Problem with select...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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]\">";

             echo "<option value=\"$i\"";
               echo" selected>$i</option>\n";
             else {

Even if I do something like this:

This seems to be true for $i=0:

"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.


Re: Problem with select...

Check the $_POST array
at the begin of the script

after the submitting a form the $_POST array is always available


gr. Olaf
PHP classes and scripts:

Re: Problem with select...

Quoted text here. Click to load it

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[].

Quoted text here. Click to load it

haven't I seen this one before?  shouldn't that be < instead of <= ?

Quoted text here. Click to load it

Site Timeline