HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 30th, 2000, 06:36 AM
warburtonrichard warburtonrichard is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: London, England
Posts: 3 warburtonrichard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dear All,

I have a form validation script that works in IE, but not in netscape, and I need obviously, it to work in both. Any suggestions you have would be greatfully received.

I'm no expert at this, but from what I can see, everything looks alright.

Hope it's a simple one...

Thanks

Richard


<script language = "JavaScript">
<!--
function validate()
{
if (form.elements[1].checked=="1" | | form.elements[3].checked=="1" | | form.elements[5].checked=="1" | | form.elements[7].checked=="1")
{
message="NextCall is best suited for BT customers who spend more than £70 per month and who pay for their service by Direct Debit";
alert(message);
return false;
}
else
{
MM_openBrWindow('http://www.MYURL.co.uk/signup/signup01.asp?mode=residential','registerwindow','status=yes,scrollbars=yes,resizable=yes,width=800,h eight=600')
return true;
}
}


function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function OpenWindowTest(){
MM_openBrWindow('http://www.MYURL.co.uk/signup/signup01.asp?mode=residential','registerwindow','status=yes,scrollbars=yes,resizable=yes,width=800,h eight=600')
return true;
}
//-->
</script>

...

And the script on the page is as follows:

<form name="form" method="get" onsubmit="return MM_callJS('validate()')">
<table border="0" cellspacing="0" cellpadding="4" width="310">
<tr>
<td colspan="2" >
<p><font face="Arial, Helvetica, sans-serif" color="#001889"><b>Register
with NextCall<br>
<img src="../gifs/Dot.gif" width="1" height="20"> </b></font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1" color="#000E78">Please
answer the following questions:</font></p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="71%" height="20" rowspan="2"><font face="sans-serif" size="-1" color="#000E78">Are
you a BT Customer?</font></td>
<td width="15%" height="20">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">Yes
</font></div>
</td>
<td width="15%" height="20">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">No</font></div>
</td>
</tr>
<tr>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="btcust" value="yes">
</font></div>
</td>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="btcust" value="no" checked>
</font></div>
</td>
</tr>
<tr>
<td width="71%" height="20" rowspan="2"><font face="sans-serif" size="-1" color="#000E78">Do
you have a Bank Account?</font></td>
<td width="15%" height="20">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">Yes
</font></div>
</td>
<td width="15%" height="20">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">No</font></div>
</td>
</tr>
<tr>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="bank" value="yes">
</font></div>
</td>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="bank" value="no" checked>
</font></div>
</td>
</tr>
<tr>
<td width="71%" rowspan="2"><font face="sans-serif" size="-1" color="#000E78">Do
You Spend £70 or more per quarter with BT?</font></td>
<td width="15%">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">Yes
</font></div>
</td>
<td width="15%">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">No</font></div>
</td>
</tr>
<tr>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="spend" value="yes">
</font></div>
</td>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="spend" value="no" checked>
</font></div>
</td>
</tr>
<tr>
<td width="71%" height="20" rowspan="2"><font face="sans-serif" size="-1" color="#000E78">Are
you the authorised person to change your telephone account?</font></td>
<td width="15%" height="20">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">Yes
</font></div>
</td>
<td width="15%" height="20">
<div align="center"><font face="sans-serif" size="-1" color="#000E78">No</font></div>
</td>
</tr>
<tr>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="auth" value="yes">
</font></div>
</td>
<td width="15%" height="20">
<div align="center"> <font face="sans-serif" size="-1" color="#000E78">
<input type="radio" name="auth" value="no" checked>
</font></div>
</td>
</tr>
</table>

</td>
</tr>
<tr>
<td width="168">&nbsp;</td>
<td width="214">
<input type="submit" name="submit" value="Send">
<input type="reset" name="reset" value="Reset">
</td>
</tr>
<tr>
<td width="168" height="32">&nbsp; </td>
<td width="214" height="32">&nbsp;</td>
</tr>
<tr>
<td width="168" colspan="2">&nbsp;</td>
</tr>
</table>

</form>



Reply With Quote
  #2  
Old September 5th, 2000, 01:43 AM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
Without spending alot of time reviewing your code, one thing pops out to me. Netscape requires syntax to be 'proper' where IE tends to be more forgiving on this point.

Everyplace you make reference to the form object should be prefaced by 'document.' For example, the following segment of your script should be:

<script language = "JavaScript">
<!--
function validate()
{
if (document.form.elements[1].checked=="1" | | document.form.elements[3].checked=="1" | | document.form.elements[5].checked=="1" | | document.form.elements[7].checked=="1")


Unless I missed something else in my brief lookthrough, I'm pretty sure this should solve your problem.

Russ

Reply With Quote
  #3  
Old September 5th, 2000, 03:18 AM
warburtonrichard warburtonrichard is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: London, England
Posts: 3 warburtonrichard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Greetings!

Thanks very much for your help... Everything works fine now URL)

Kind regards

Richard

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Script Works in IE, not in Netscape!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway