Hi All,
The following code works as a charm in IE. Every time I select a radio button the hidden fields gets populated and clicking Preview gets appropriate page. But Netscape doesn't seem to recognize the onChange event. Any suggestions?
Thanks for your help,
Regards,
Rakesh
<HTML>
<HEAD>
<script language="Javascript">
function Preview(){
if (document.SelectionForm.sporttext.value == ""
{
alert("You must select category and sport."
;
return false;
} else if (document.SelectionForm.categorytext.value == ""
{
alert("You must select category and sport."
;
return false;
}
var category = document.SelectionForm.categorytext.value;
var sport = document.SelectionForm.sporttext.value;
if (sport == 'baseball') {
if (category == 'less20') {
popupWin = window.open('baseballless20.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
} else {
popupWin = window.open('baseballover50.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
}
} else {
if (category == 'less20') {
popupWin = window.open('hockeyless20.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
} else {
popupWin = window.open('hockeyover50.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
}
}
}
</script>
</HEAD>
<BODY topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<FORM name="SelectionForm">
<STRONG>1. Do you play baseball or hockey? <font color="#ff0000"> *</font></STRONG>
<BR><font size="2" face="arial">
<input type="hidden" name ="sporttext" value="">
<input type="radio" name ="sport" value="baseball" onchange="document.SelectionForm.sporttext.value = 'baseball'" > Baseball
<input type="radio" name ="sport" value="hockey" onchange="document.SelectionForm.sporttext.value = 'hockey'" > Hockey
</font>
<BR>
<STRONG>2. What category do you fit in? <font color="#ff0000"> *</font></STRONG>
<BR><font size="2" face="arial">
<input type="hidden" name ="categorytext" value="">
<input type="radio" name ="category" value="less20" onchange="document.SelectionForm.categorytext.value = 'less20'" >Less than 20
<input type="radio" name ="category" value="20-50" onchange="document.SelectionForm.categorytext.value = '20-50'" > 20 - 50
<input type="radio" name ="category" value="over50" onchange="document.SelectionForm.categorytext.value = 'over50'" > Over 50
</font>
<div align="center">
<a href="#" onclick="Preview(); return true"><img src="images/buttons/prev_form.gif" border="0" alt="Preview Form"></a>
</div>
</FORM>
</BODY>
</HTML>
The following code works as a charm in IE. Every time I select a radio button the hidden fields gets populated and clicking Preview gets appropriate page. But Netscape doesn't seem to recognize the onChange event. Any suggestions?
Thanks for your help,
Regards,
Rakesh
<HTML>
<HEAD>
<script language="Javascript">
function Preview(){
if (document.SelectionForm.sporttext.value == ""
alert("You must select category and sport."
return false;
} else if (document.SelectionForm.categorytext.value == ""
alert("You must select category and sport."
return false;
}
var category = document.SelectionForm.categorytext.value;
var sport = document.SelectionForm.sporttext.value;
if (sport == 'baseball') {
if (category == 'less20') {
popupWin = window.open('baseballless20.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
} else {
popupWin = window.open('baseballover50.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
}
} else {
if (category == 'less20') {
popupWin = window.open('hockeyless20.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
} else {
popupWin = window.open('hockeyover50.htm', '_new',
'width=790,height=590,toolbar=no,location=middle,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes', 'True');
}
}
}
</script>
</HEAD>
<BODY topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<FORM name="SelectionForm">
<STRONG>1. Do you play baseball or hockey? <font color="#ff0000"> *</font></STRONG>
<BR><font size="2" face="arial">
<input type="hidden" name ="sporttext" value="">
<input type="radio" name ="sport" value="baseball" onchange="document.SelectionForm.sporttext.value = 'baseball'" > Baseball
<input type="radio" name ="sport" value="hockey" onchange="document.SelectionForm.sporttext.value = 'hockey'" > Hockey
</font>
<BR>
<STRONG>2. What category do you fit in? <font color="#ff0000"> *</font></STRONG>
<BR><font size="2" face="arial">
<input type="hidden" name ="categorytext" value="">
<input type="radio" name ="category" value="less20" onchange="document.SelectionForm.categorytext.value = 'less20'" >Less than 20
<input type="radio" name ="category" value="20-50" onchange="document.SelectionForm.categorytext.value = '20-50'" > 20 - 50
<input type="radio" name ="category" value="over50" onchange="document.SelectionForm.categorytext.value = 'over50'" > Over 50
</font>
<div align="center">
<a href="#" onclick="Preview(); return true"><img src="images/buttons/prev_form.gif" border="0" alt="Preview Form"></a>
</div>
</FORM>
</BODY>
</HTML>