Forum Moderators: open
Here is the code that I have for the javascript for the two boxes:
if(MM_findObj('firstname').value.length < 2 ¦¦ MM_findObj('lastname').value.length < 2 ¦¦ MM_findObj('street').value.length < 2 ¦¦ MM_findObj('city').value.length < 2 ¦¦ MM_findObj('prodName').value.length < 2){
MM_findObj('firstname').className='error';
MM_findObj('lastname').className='error';
MM_findObj('street1').className='error';
MM_findObj('city').className='error';
MM_findObj('prodName').className='error';
errors+='The Highlighted spaces must have at least 2 characters. Please make sure you have the product name included.\n';
}
if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
function setOptions(chosen) {
var selbox = document.rmavalidation.opttwo;
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('--Please choose a model--',' ');
}
if (chosen == "MFS") {
selbox.options[selbox.options.length] = new Option('--Please choose a model--');
selbox.options[selbox.options.length] = new Option('');
selbox.options[selbox.options.length] = new Option('');
}
if (chosen == "EH") {
selbox.options[selbox.options.length] = new Option('--Please choose a model--');
selbox.options[selbox.options.length] = new Option('');
selbox.options[selbox.options.length] = new Option('');
}
if (chosen == "FM") {
selbox.options[selbox.options.length] = new Option('--Please choose a model--');
selbox.options[selbox.options.length] = new Option('');
selbox.options[selbox.options.length] = new Option('');
}
if (chosen == "MM") {
selbox.options[selbox.options.length] = new Option('--Please choose a model--');
selbox.options[selbox.options.length] = new Option('');
selbox.options[selbox.options.length] = new Option('');
}
if (chosen == "DC") {
selbox.options[selbox.options.length] = new Option('--Please choose a model--');
selbox.options[selbox.options.length] = new Option('');
selbox.options[selbox.options.length] = new Option('');
}
}
and this is in the html code for the two boxes:
<tr>
<td><font color="red">*</font>Product Category:<br /> </td>
<td ><select name="optone" size="1"
onchange="setOptions(document.rmavalidation.optone.options[document.rmavalidation.optone.selectedIndex].value);" required>
<option>--Please choose a category--</option>
<option value="MFS<font size="-1">TM</font></option>
<option value="EH</option>
<option value="FM</option>
<option value="Digital Cables">DC</option>
<option value="MM</option>
</select><br /><br /></td></tr>
<tr><td><font color="red">*</font>Product Model:<br /></td><td>
<select name="opttwo" size="1" required>
<option value>--Please Choose a Model--</option>
</select> <br /><br />
</td>
</tr>
Thank you so much for your help with this. I really appreciate any point in the right direction.