View Full Version : Creating Form options

18 Jan 2012, 11:31 PM
I'm not much of a pro, yet. I don't even know what to Google for this one. I have an existing form that has a few options, one of which when a specific option is selected, it then generates a text field to fill out. I need to do the same thing for another option being selected but instead generating another select options.
What would even be a search term for this?

<select id="Program" name="Program" size="1" onchange="
$other = document.getElementById('other_program').style;
$invoice = document.getElementById('invoice');
if (selectedIndex==6) {
if ($invoice.value == 'General Fund') $invoice.value='';
} else {
if (selectedIndex==1) {
$invoice.value='Renegade Fund';
} else {
$invoice.value='Please Specify';
<option selected="selected" value="Not Selected"> - - Select One - - </option>
<option value="Athletics">Athletics</option>
<option value="Drum Line">Drum Line</option>
<option value="Renegade Fund">Renegade Fund</option>
<option value="General Scholarships">General Scholarships</option>
<option value="President's Circle">President's Circle</option>
<option value="Other">Other</option>

<span id="other_program"><input type="text" id="invoice" name="invoice" size="15" /></span>
<!-- the following is what will be set up for another option after Athletics is selected
<span id="alumni">
<select id="select-alumni" name="select-alumni" size="1">
<option selected="selected" value="Not Selected">Yes or No</option>
<option value="Yes-alumni">Yes</option>
<option value="Not-alumni">No</option>