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

Having problems with netscape

Status
Not open for further replies.

Harshmellow

Programmer
Mar 28, 2002
18
BR
Hello!

I´m using a javascript and it works fine on Explorer browsers, but it doesn´t work in Netscape. Why does this happen and HOW can I solve this? Asap!

my code is as follows:

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

function validate(form)
{
if (form.pass.value != form.confirmpass.value) {
alert(&quot;Passwords do not match!&quot;);
form.pass.value = '';
form.confirmpass.value = '';
form.pass.focus();
return false;
}
return true;
}
</SCRIPT>


And the function is called from the onSubmit form function.

Thanks in advance, .: HarshMellow :. &quot;Sperto ne estas tio, kio okazis al vi, sed estas tio, kion vi faras al tio, kio okazas al vi.&quot; (Aldous Huxley)
 
What does the call to the function look like? Show the code you wrote for that.
 
Hello trollacious,

the code is as follow:

<form method=&quot;POST&quot; action=&quot;FileName&quot; name=&quot;form&quot; onSubmit=&quot;return validate(this)&quot;>

Could it be something here?

Thanks, .: HarshMellow :. &quot;Sperto ne estas tio, kio okazis al vi, sed estas tio, kion vi faras al tio, kio okazas al vi.&quot; (Aldous Huxley)
 
Hey, I found out the following:

I'm new to scripting and I don't understand too much about parameters and so (really dumb must I be, huh), but what I've done, which solved the problem, is to name (I think this is how its called) the directory to a parameter (I think), like:

function validate(form)
{
pass = frm.pass.value
confirmpass = frm.confirmpass.value
   if (pass != confirmpass) {
      alert(&quot;Passwords do not match!&quot;);
      pass = '';
      confirmpass = '';
      frm.pass.focus();
      return false;
   }
   return true;
}


It worked fine for verifying the two fields, but it didn't work to erase the values... even when I changed the code like the older one for the part frm.pass.value = '';... but still worked the focus.

Thanks again!
.: HarshMellow :. &quot;Sperto ne estas tio, kio okazis al vi, sed estas tio, kion vi faras al tio, kio okazas al vi.&quot; (Aldous Huxley)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top