I am having a whale of time trying to figure out what is causing Netscape to not work with a piece of JavaScript; the same piece DOES work in IE, however. Here's what I have:
<input type=text onfocus="chkDonOffice()" name="email1" size="20" value="@abc.com">
(The above piece of code places the value '@abc.com' in a text field 'email1' with the assumption that the user will add their username in front of the '@' symbol. You'll note, though, that the function 'chkDonOffice' is called with an 'onfocus' event.)
function chkDonOffice()
{
if (document.forms[0].DonOff.value == "1030" || document.forms[0].DonOff.value == "1035")
{
document.forms[0].email1.value='newclient@abc.com'
return true;
}
}
(This piece of code above represents the function 'chkDonOffice'. If a previous field on the form - DonOff - was populated with either the value '1030' or '1035', the value of the 'email1' text area should be populated with 'newclient@abc.com'.)
As I mentioned earlier, this works well on IE, with no errors received. While an error is not received on Netscape, the desired action is not performed. Any thoughts?
Thanks!
Brent
<input type=text onfocus="chkDonOffice()" name="email1" size="20" value="@abc.com">
(The above piece of code places the value '@abc.com' in a text field 'email1' with the assumption that the user will add their username in front of the '@' symbol. You'll note, though, that the function 'chkDonOffice' is called with an 'onfocus' event.)
function chkDonOffice()
{
if (document.forms[0].DonOff.value == "1030" || document.forms[0].DonOff.value == "1035")
{
document.forms[0].email1.value='newclient@abc.com'
return true;
}
}
(This piece of code above represents the function 'chkDonOffice'. If a previous field on the form - DonOff - was populated with either the value '1030' or '1035', the value of the 'email1' text area should be populated with 'newclient@abc.com'.)
As I mentioned earlier, this works well on IE, with no errors received. While an error is not received on Netscape, the desired action is not performed. Any thoughts?
Thanks!
Brent