JSFiddle - React, Tailwind, and code Playground
HTML
<form name="myform">
<div align="center">
<p>Prompt Category:
<select name="optone" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);">
<option value="Prompt Category" selected="selected"></option>
<option value="1">Advertisement</option>
<option value="2">Asked to Call / Call Back</option>
<option value="3">Bank / Card Debited</option>
<option value="4">Checked Bill / Balance</option>
<option value="5">Consult Call</option>
<option value="6">Customer Desire</option>
<option value="7">Customer Going Abroad</option>
<option value="8">Loss/Theft</option>
<option value="9">Needed Instruction</option>
<option value="10">Promise Not Forfilled</option>
<option value="11">Promoted on Call by Advisor</option>
<option value="12">Promotion Not Received</option>
<option value="13">Received Communication</option>
<option value="14">Receiving Nuisance Calls</option>
<option value="15">Unable to Self-Serve</option>
<option value="16">Unable to Use Accessory</option>
<option value="17">Unable to Use Device</option>
<option value="18">Unable to Use Service</option>
<option value="19">Wanted Confirmation</option>
</select>
<br />
<br />Prompt Detail:
<select name="opttwo" size="1">
<option value="Please Select Prompt Category" selected="selected">Please Select Prompt Category</option>
</select>
</p>
<p>
<input type="button" name="go" value="Submit">
</p>
</div>
</form>
JavaScript
function setOptions(chosen) {
var selbox = document.myform.opttwo;
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please Select Prompty Category', ' ');
}
if (chosen == "1") {
selbox.options[selbox.options.length] = new Option('123213123123', 'oneone');
selbox.options[selbox.options.length] = new Option('23123123123', 'onetwo');
}
if (chosen == "2") {
selbox.options[selbox.options.length] = new Option('23121312312', 'twoone');
selbox.options[selbox.options.length] = new Option('3211231232', 'twotwo');
selbox.options[selbox.options.length] = new Option('2131223213', 'twothree');
selbox.options[selbox.options.length] = new Option('32123213213', 'twofour');
}
if (chosen == "3") {
selbox.options[selbox.options.length] = new Option('Not Applicable', 'threeone');
}
if (chosen == "4") {
selbox.options[selbox.options.length] = new Option('Not Applicable', 'fourone');
}
if (chosen == "5") {
selbox.options[selbox.options.length] = new Option('23213123123', 'fiveone');
selbox.options[selbox.options.length] = new Option('2312132312', 'fivetwo');
selbox.options[selbox.options.length] = new Option('12312123213', 'fivethree');
selbox.options[selbox.options.length] = new Option('21213231321', 'fivefour');
selbox.options[selbox.options.length] = new Option('213213213', 'fivefive');
selbox.options[selbox.options.length] = new Option('23213132123', 'fivesix');
}
if (chosen == "6") {
selbox.options[selbox.options.length] = new Option('Not Applicable', 'sixone');
}
if (chosen == "7") {
selbox.options[selbox.options.length] = new Option('Not Applicable', 'sevenone');
}
if (chosen == "8") {
selbox.options[selbox.options.length] = new Option('Not Applicable', 'eighone');
}
if (chosen == "9") {
...