Forum Moderators: open

Message Too Old, No Replies

validation in netscape version 4

validation works in IE and netscape 6 but not in Netscape 4

         

harrya

8:12 am on Mar 18, 2002 (gmt 0)



Hi I am new to this and was hoping some guru out there could help, I am trying to validate some drop down list entries in a form, which works fine except netscape version 4, can anyone help? the code i am using is like this:

function checkform_onsubmit()
{
var returnValue = false;
var myform = document.form1;
if (myform.alone_potential_friend.value == " " ¦¦ myform.alone_potential_neighbour.value == " " )
{alert ("Please complete all fields.");}
else
{
returnValue = true;
}
return returnValue;

}
I have also tried seperating out the different entries using "if else" but get the same result.

Thanks

DrDoc

8:15 am on Mar 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



NN4 doesn't like "return false" on a submit request.

How about this ..

1) Change the submit button to just a regular button .. with onclick="checkform_onsubmit()"

function checkform_onsubmit()
{
if (document.form1.alone_potential_friend.value == " " ¦¦ document.form1.alone_potential_neighbour.value == " " )
{alert("Please complete all fields.");}
else{document.form1.submit();
}
}

harrya

3:38 pm on Mar 18, 2002 (gmt 0)



Thanks for the swift reply, but unfortunately, nothing has changed, the validation works great in IE and netscape 6 but not in netscape 4, Javascript support is definitly switched on.

Any more ideas?

Thanks