Jump to content

Form Input HELP!


phpHUH

Recommended Posts

:'(

 

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?

Link to comment
https://forums.phpfreaks.com/topic/85438-form-input-help/
Share on other sites

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> 

Link to comment
https://forums.phpfreaks.com/topic/85438-form-input-help/#findComment-435931
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.