tonyappleby36
12-04-2006, 11:31 PM
Hi all,
Can any one tell me how to load up different pages to an inframe using some form. I want to load up page1 or page2 depending on the condition. Sounds simple enough? Here what i have so far: Thanks.
<script type="text/javascript">
<!--
// This is the check script
function checkit()
{
// In textstring I gather the data that are finally written to the textarea.
var textstring = '';
var display_selected = '';
var user_input = '';
for (i=0;i<document.forms[0].uutType.length;i++) {
if (document.forms[0].uutType[i].checked) {
user_input = document.forms[0].uType[i].value;
display_selected = document.displayOptions.displays.options[document.displayOptions.displays.selectedIndex].value
if(document.forms[0].uType[i].value=="B")
{
switch (display_selected)
{
case "NE":
window.location="page1.html"; //<---
break
case "PA":
window.location="page2.html";//<----
break
}//end switch
}//end if checked
}//for
user_input = document.displayOptions.displays.options[document.displayOptions.displays.selectedIndex].value
}
// -->
</script>
<style type="text/css">
td[colspan] {
text-align: center;
}
</style>
</head>
<body>
<form name="displayOptions" action="#" onsubmit="checkit(); return false">
<table class="form">
<tr>
<td>
<input type="radio" name="uType" value="Mxx" />Mxx
<input type="radio" name="uType" value="Bxx" />Bxx
<select name="displays">
<option value='' selected="selected">--- Select ---</option>
<option value="NE">NES</option>
<option value="PA">PAS</option>
</select>
<input type="submit" value="go" />
<input type="reset" /></td></tr>
</table>
</form>
<iframe name="IconFera" style="" frameborder="0" scrolling="no" width="627" marginwidth="0" marginheight="0" height="1088" src="default.htm"></iframe>
</div>
</body>
</html>
Can any one tell me how to load up different pages to an inframe using some form. I want to load up page1 or page2 depending on the condition. Sounds simple enough? Here what i have so far: Thanks.
<script type="text/javascript">
<!--
// This is the check script
function checkit()
{
// In textstring I gather the data that are finally written to the textarea.
var textstring = '';
var display_selected = '';
var user_input = '';
for (i=0;i<document.forms[0].uutType.length;i++) {
if (document.forms[0].uutType[i].checked) {
user_input = document.forms[0].uType[i].value;
display_selected = document.displayOptions.displays.options[document.displayOptions.displays.selectedIndex].value
if(document.forms[0].uType[i].value=="B")
{
switch (display_selected)
{
case "NE":
window.location="page1.html"; //<---
break
case "PA":
window.location="page2.html";//<----
break
}//end switch
}//end if checked
}//for
user_input = document.displayOptions.displays.options[document.displayOptions.displays.selectedIndex].value
}
// -->
</script>
<style type="text/css">
td[colspan] {
text-align: center;
}
</style>
</head>
<body>
<form name="displayOptions" action="#" onsubmit="checkit(); return false">
<table class="form">
<tr>
<td>
<input type="radio" name="uType" value="Mxx" />Mxx
<input type="radio" name="uType" value="Bxx" />Bxx
<select name="displays">
<option value='' selected="selected">--- Select ---</option>
<option value="NE">NES</option>
<option value="PA">PAS</option>
</select>
<input type="submit" value="go" />
<input type="reset" /></td></tr>
</table>
</form>
<iframe name="IconFera" style="" frameborder="0" scrolling="no" width="627" marginwidth="0" marginheight="0" height="1088" src="default.htm"></iframe>
</div>
</body>
</html>