Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape problems

Status
Not open for further replies.

MENON

Programmer
Jul 23, 2001
28
US
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=&quot;Javascript&quot;>
function Preview(){
if (document.SelectionForm.sporttext.value == &quot;&quot;) {
alert(&quot;You must select category and sport.&quot;);
return false;
} else if (document.SelectionForm.categorytext.value == &quot;&quot;) {
alert(&quot;You must select category and sport.&quot;);
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=&quot;0&quot; leftmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>
<FORM name=&quot;SelectionForm&quot;>
<STRONG>1.  Do you play baseball or hockey? <font color=&quot;#ff0000&quot;> *</font></STRONG>
<BR><font size=&quot;2&quot; face=&quot;arial&quot;>
<input type=&quot;hidden&quot; name =&quot;sporttext&quot; value=&quot;&quot;>
<input type=&quot;radio&quot; name =&quot;sport&quot; value=&quot;baseball&quot; onchange=&quot;document.SelectionForm.sporttext.value = 'baseball'&quot; > Baseball  
<input type=&quot;radio&quot; name =&quot;sport&quot; value=&quot;hockey&quot; onchange=&quot;document.SelectionForm.sporttext.value = 'hockey'&quot; > Hockey
</font>
<BR>
<STRONG>2.  What category do you fit in? <font color=&quot;#ff0000&quot;> *</font></STRONG>
<BR><font size=&quot;2&quot; face=&quot;arial&quot;>
<input type=&quot;hidden&quot; name =&quot;categorytext&quot; value=&quot;&quot;>
<input type=&quot;radio&quot; name =&quot;category&quot; value=&quot;less20&quot; onchange=&quot;document.SelectionForm.categorytext.value = 'less20'&quot; >Less than 20   
<input type=&quot;radio&quot; name =&quot;category&quot; value=&quot;20-50&quot; onchange=&quot;document.SelectionForm.categorytext.value = '20-50'&quot; > 20 - 50   
<input type=&quot;radio&quot; name =&quot;category&quot; value=&quot;over50&quot; onchange=&quot;document.SelectionForm.categorytext.value = 'over50'&quot; > Over 50
</font>
<div align=&quot;center&quot;>
<a href=&quot;#&quot; onclick=&quot;Preview(); return true&quot;><img src=&quot;images/buttons/prev_form.gif&quot; border=&quot;0&quot; alt=&quot;Preview Form&quot;></a>
</div>
</FORM>
</BODY>
</HTML>
 
I didn't, what a shame.

It works now, Thanks vituz. U R GOD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top