March 13, 201016 yr Hi I'm new and i'm not sure what the correct name for this is. I have drop down lists on separate pages and want them linked to each other. i.e. the first list has options 1,2,3,4 if i select 1 and submit, it will take me to another page with a drop down list displaying 1's options, but if i select 2, it will take me to the same page but with the drop down list displaying 2's options, can some one help, i guess it's javascript which is why i have put the message in this section. code i already have is: PAGE_1.php <html><head></head><body> <form method="get" action="PAGE_2.php"> <select name="material"> <option value="Acrylic">Acrylic</option> <option value="Block Mounted">Block Mounted</option> <option value="Canvas">Canvas</option> <option value="Clipped">Clipped</option> <option value="Framed">Framed</option> </select> <input type="submit" value="next page" /> </form> </body></html> PAGE_2.php <html><head></head><body> <form method="get" action="PAGE_3.php?"> <input type="hidden" name="material" value="<?php echo $_GET['material']; ?>"> <select name="color"> <option value="blue">blue</option> <option value="red">red</option> <option value="yellow">yellow</option> </select> <input type="submit" value="next page" /> </form> </body></html> PAGE_3.php <html><head></head><body> <?php echo "material = " . $_GET['material']; echo "<br /><br />color = " . $_GET['color']; ?> </body></html>
March 13, 201016 yr The nearest I can suggest is chained select boxes (javascript) where a choice in the first box changes the choices in the second select box and a choice there changes the selection in a third. http://www.dynamicdrive.com/dynamicindex16/chainedselects/index.htm or the chained select menu http://www.dynamicdrive.com/dynamicindex1/chainedmenu/index.htm
March 13, 201016 yr If you have the checkboxes on multiple pages it'd prob be best to write something server side for that: Maybe: if ($_POST['material'] == 'Acrylic') { echo 'check box based on arcylic'; } elseif ($_POST['material'] == 'Block Mounted') { echo 'check box based on block mounted'; } etc. etc.
Create an account or sign in to comment