Hi, I have two Dropdown menus: <FORM NAME="myform1" action="phones.php"> <SELECT NAME="mylist1" onChange="this.form.submit();"> <OPTION VALUE="Null"></OPTION> <OPTION VALUE="S500i">Sony Ericsson S500i</OPTION> </SELECT> </FORM> <FORM NAME="myform2" action="phones.php"> <SELECT NAME="mylist2" onChange="this.form.submit();"> <OPTION VALUE="Null"></OPTION> <OPTION VALUE="S500i">Sony Ericsson M600i</OPTION> </SELECT> </FORM> HTML: So if I for example have phones.php: <FORM NAME="myform1" action="phones.php"> <SELECT NAME="mylist1" onChange="this.form.submit();"> <OPTION VALUE="Null"></OPTION> <OPTION VALUE="S500i">Sony Ericsson S500i</OPTION> </SELECT> </FORM> <FORM NAME="myform2" action="phones.php"> <SELECT NAME="mylist2" onChange="this.form.submit();"> <OPTION VALUE="Null"></OPTION> <OPTION VALUE="M600i">Sony Ericsson M600i</OPTION> </SELECT> </FORM> <?php echo $mylist1; echo $mylist2; ?> PHP: The problem is that when user for example chooses Sony Ericsson S500i from myform1... when the submit is done the myform1 shows the "Null" value, not the Sony Ericsson S500i. How to change this? Bigger problems is that when user first uses the myform1 and then the myform2, it doesn't remember the myform1 value. is there any way to submit those forms in the same time? Huh, I hope got it Anyone?
your php code is wrong. i think for action instead you could use <?=$_SERVER['PHP_SELF']?> not too sure how action="phones.php" is working for you. does the form show any values at all? i think it is because you are not grabbing values into your variables. how is $mylist1 and $mylist2 set? if you want to grab it off your form you will need to have $mylist1=$_POST['myform1'] $mylist2=$_POST['myform2'] PHP: assuming that it grabs from form name not select name? (not too sure)
Ok. Not sure if I made my self clear enought Try this: http://www.sefanatics.com/PUHELIN VERTAILU/index.php Choose from the list one Sony Ericsson S500i and then choose from the list two Sony Ericsson S500i. The problem is that it doesn't remember the values that are shown when you made the first choose (list one). The site isn't ready so there might be weird things... and the thirth list doesn't work...
well, i actually just get when i select something from the second one. try adding this to your first value="<?=$_POST['myform1']?>" PHP: at least, i think thats how you set default in select forms? sorry, i'm not too sure how you would set the default. at any rate, just change "value" to whatever you need to set the default. this should set it only if it has an option selected, but if not, then you can just loop it into an if function