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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.location.href not working in Netscape 7.02 1

Status
Not open for further replies.

jillallynwilson

Programmer
Apr 14, 2004
21
US
The following code works in IE6.0, but not in Netscape 7.02.

The submit button does work, because if I clear the email address and try to submit the form with a blank value, the alert is presented. Also, the alert (bebug purpose only) is presented in the browser if the email address is not blank, but the URL is never executed.

Can anyone help me out?

Thank you in advanced.
_____________________________________

<html><head><title>Scott Specialty Gases - eScott 3 Year History</title>
<script language="JavaScript" type="text/JavaScript">
function submitIt()
{
var df = window.document.ThreeYear;
var UNID = df.UNID.value;
var CustNo = df.CUSTNO.value;
var NeweMail = df.EMAIL.value;
if (NeweMail == "")
{
alert("eMail Address is required to complete request.");
}
else
{
alert("Run Report")
document.location.href("/eScott2.nsf/(3YearHistoryRun)?OpenAgent&UNID=" +UNID + "&CustNo=" + CustNo + "&eMail=" + NeweMail);
}
}
</script>

<style type="text/css">
<!--
body, td { font-family : Arial, Helvetica, sans-serif; font-size: 12px;
font-style: normal}

.THeading {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: bold;
text-align: left;
background-color: #E2E2E2;}

a:active {color: #3163CE; Text-Decoration : underline;}
a:link {color: #3163CE; text-decoration: underline}
a:visited {color: #3163CE; text-decoration: underline}
-->
</style>
</head>
<body bgcolor="#BDCEEF" leftmargin="3" topmargin="0" marginwidth="0" marginheight="0">
<br>A <b>3 year history report</b> will be emailed to the following address. Please make any corrections and then select Submit.
<form name="ThreeYear">
<input type="hidden" name="UNID" value="XXXXXXXXXXXX">
<input type="hidden" name="CUSTNO" value="XXXXXXXX">
<input type="text" name="EMAIL" size="40" maxlength="40" value="tkariger@scottgas.com"><p>

<a href="#" onClick="submitIt()"><b>Submit</b></font></a>
</p></form></body></html>
 
Try this

document.location.href = "/eScott2.nsf/(3YearHistoryRun)?OpenAgent&UNID=" +UNID + "&CustNo=" + CustNo + "&eMail=" + NeweMail;



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Thank you mwolf00!!!!

I am just learning JavaScript and this was a great help, which did fix the problem in Netscape and it still works in IE.

Again -- THANK YOU :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top