Orignally I was looking for a way to populate a OPTION list with an external HTML file that would be cached by the browser because of it’s size (450k).
Since there isn’t anything like an HTML INCLUDE option and doing a JAVASCRIPT WRITELN would take too long (10,000 values). I settled on using IFRAME and the SRC option to allow the browser to cache this large/static snippet of HTML (saving network bandwidth).
The problem now is that when the user submits the form, the item selected in the IFRAME is not sent along with the GET/POST header.
To work around that problem I decided to make a hidden field (unhidden in the example below) that would get populated at an ONCLICK event in the IFRAME. However, that doesn’t seem to work; it’s like the IFRAME can’t access the parent’s JSCRIPT functions. Who knows??!?
Any ideas? I also need to know the correct syntax for the Function to get the IFRAME’s OPTION SELECTED value.
A bazillion thanks to the all knowing person who figures this out!!
[email][email protected]
<html>
<head>
<title>Quick Drug List Load</title>
<script language=”JavaScript” type=”text/JavaScript”>
<!–
function UpdateField() {
document.DrugTest.drugselected.value = “NEED TO GET VALUE FROM IFRAME OPTION FIELD HERE. WHAT IS THE PROPER JSCRIPT TO DO THIS?”;
}
//–>
</script>
</head>
<body>
<form action=”
<table width=”45%” border=”0″ cellspacing=”-1″ cellpadding=”-1″>
<tr>
<td width=”28%” valign=”top”><div align=”right”>Title Here</div></td>
<td width=”3%”></td>
<td width=”69%”><input name=”drugtext” type=”text” id=”drugtext”></td>
</tr>
<tr>
<td valign=”top”><div align=”right”>Title Here</div></td>
<td></td>
<td><input name=”drugcheck” type=”checkbox” id=”drugcheck” value=”checkbox”></td>
</tr>
<tr>
<td valign=”top”><div align=”right”>Title Here</div></td>
<td></td>
<td>
<input name=”drugselected” id=”drugselected”>
<iframe src=”list2.htm” scrolling=”no” frameborder=”0″ marginwidth=”0″ width=”380″ height=”100″></iframe>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type=”submit” name=”Submit” value=”Submit”></td>
</tr>
</table>
</form>
</body>
<select name=”select” size=”5″ onclick=”UpdateField()”>
<option value =”1″>1 Plus 1 F</option>
<option value =”2″>1000 BC</option>
<option value =”3″>12 Hour Antihistamine/Decongestant</option>
<option value =”4″>12 Hour Cold</option>
<option value =”5″>12 Hour Nasal</option>
<option value =”6″>12 Hour Nasal Tablet</option>
<option value =”7″>40 Winks</option>
<option value =”8″>4-Way Fast Acting Nasal Spray</option>
<option value =”9″>5-Aminosalicylic Acid</option>
<option value =”10″>8-Mop</option>
<option value =”11″>A & D</option>
<option value =”12″>A.P.L.</option>
<option value =”13″>A.R.M. Allergy Relief</option>
<option value =”14″>A/B Otic</option>
<option value =”15″>A/Fish Oil</option>
<option value =”16″>A/T/S</option>
<option value =”17″>A-200 Lice Control</option>
<option value =”18″>A-200 Lice Treatment</option>
<option value =”19″>A-25</option>