javascript won't work with FireFox

I

Igal

hay. i'm working on some site, the code is pretty old, it has some form
validation JS scripts. but seems like they work only in IE, won't work
with FireFox. here's a example:

<script language="JavaScript" type="text/javascript">
<!--
function check1(){
if (form1.name.value==""){
alert("type your name");
form1.name.focus();
return false;
}
if (form1.mail.value.indexOf("@")==-1){
alert("wrong e-mail");
form1.mail.focus();
return false;
}
if (form1.mail.value.indexOf(".")==-1){
alert("wrong e-mail");
form1.mail.focus();
return false;
}
form1.session_exp.value= "qqq" + form1.name.value + "qqq" +
form1.mail.value + "qqq"
}
//-->
</script>

....<form action="../SendCv/SendCv2.asp" method="post" name="form1"
onsubmit="return check1()">...

what can be wrong with it?
 
A

ASM

Igal a écrit :
hay. i'm working on some site, the code is pretty old, it has some form
validation JS scripts. but seems like they work only in IE, won't work
with FireFox. here's a example:

You can't use (or it is preferable you don't use)
'name' to name an input

Then : what is 'form1' in your function ?
use at least : document.form1

And ... elements of your form have they a name ?
(an id is not a name !)

what can be wrong with it?

see above
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top