esthera
12-01-2004, 12:29 PM
I have a form that has one select box calling another - so I am using an iframe.
See the following code:
What I need to do now is show the iframe select box when the page loads with a default value but with it still working that if the user changes the first select box - the second will change as well.
in the second file (in the iframe) I just have the second select box and I will have the correct value displayed - I just want to know how to show it when the page loads.
Can someone help me?
<SCRIPT language="JavaScript1.2">
function getIframe()
{
document.OrderForm.dd.value=parent.iframe1.document.form2.elements[0].value;
}
</SCRIPT>
</head>
<form method="post" action="enter.asp" name="OrderForm" class="typo" onsubmit="getIframe()"><input type=hidden name=orderitemid value=88207>
<Select id="scale" name="scale" size="0" onChange= 'document.getElementById("iframe1").src="doubledye.asp?scale=" + this.value'><option value='n'>Please Select a scale</option>
<OPTION value='1'>1 </option><OPTION value='40'>40 </option><OPTION value='200' selected>200</option></Select>
</td>
<td><B>select box 2</B>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="100%" colspan="2"> 5' select here</td>
</tr>
<tr>
<td colspan="2" width="100%">
<iframe id="iframe1" name='iframe1' FRAMEBORDER=0 SCROLLING='no' WIDTH=300 HEIGHT=55></iframe>
See the following code:
What I need to do now is show the iframe select box when the page loads with a default value but with it still working that if the user changes the first select box - the second will change as well.
in the second file (in the iframe) I just have the second select box and I will have the correct value displayed - I just want to know how to show it when the page loads.
Can someone help me?
<SCRIPT language="JavaScript1.2">
function getIframe()
{
document.OrderForm.dd.value=parent.iframe1.document.form2.elements[0].value;
}
</SCRIPT>
</head>
<form method="post" action="enter.asp" name="OrderForm" class="typo" onsubmit="getIframe()"><input type=hidden name=orderitemid value=88207>
<Select id="scale" name="scale" size="0" onChange= 'document.getElementById("iframe1").src="doubledye.asp?scale=" + this.value'><option value='n'>Please Select a scale</option>
<OPTION value='1'>1 </option><OPTION value='40'>40 </option><OPTION value='200' selected>200</option></Select>
</td>
<td><B>select box 2</B>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="100%" colspan="2"> 5' select here</td>
</tr>
<tr>
<td colspan="2" width="100%">
<iframe id="iframe1" name='iframe1' FRAMEBORDER=0 SCROLLING='no' WIDTH=300 HEIGHT=55></iframe>