phpHUH Posted January 10, 2008 Share Posted January 10, 2008 :'( I'm completely stuck, HELP! This is pretty much the last thing I need to finish to get my business on the web. I have an order form for my personalized children's book, however I need couple of fields that will come up in the form only if specific books are called. Is that something I can do with PHP? Quote Link to comment Share on other sites More sharing options...
phpSensei Posted January 10, 2008 Share Posted January 10, 2008 That is Javascript... <script language="javascript"> <!-- function setOptions(chosen) { var selbox = document.myform.opttwo; selbox.options.length = 0; if (chosen == " ") { selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' '); } if (chosen == "1") { selbox.options[selbox.options.length] = new Option('first choice - option one','oneone'); selbox.options[selbox.options.length] = new Option('first choice - option two','onetwo'); } if (chosen == "2") { selbox.options[selbox.options.length] = new Option('second choice - option one','twoone'); selbox.options[selbox.options.length] = new Option('second choice - option two','twotwo'); } if (chosen == "3") { selbox.options[selbox.options.length] = new Option('third choice - option one','threeone'); selbox.options[selbox.options.length] = new Option('third choice - option two','threetwo'); } } --> </script> <form name="myform"><div align="center"> <select name="optone" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);"> <option value=" " selected="selected"> </option> <option value="1">First Choice</option> <option value="2">Second Choice</option> <option value="3">Third Choice</option> </select><br /> <br /> <select name="opttwo" size="1"> <option value=" " selected="selected">Please select one of the options above first</option> </select> <input type="button" name="go" value="Submit"> </div></form> Quote Link to comment Share on other sites More sharing options...
drummer101 Posted January 10, 2008 Share Posted January 10, 2008 Edit: phpSensei: He could do it if he had, http:foo.bar/order.php?id=45 Quote Link to comment Share on other sites More sharing options...
revraz Posted January 10, 2008 Share Posted January 10, 2008 If you want to use mutiple forms/submits, then sure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.