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

return false does not stop form submit on mac

Status
Not open for further replies.

BillLumbergh

Programmer
Aug 15, 2001
51
US
We're building a site that must function on both IE & Netscape for both PC & Mac. We're seeing the following issue and cannot find anyone else documenting the same problem, but I think someone must have come across this before and might know the solution:

We're running some Javascript form validation when the user clicks the submit button (the button is an input of type 'button'). When the validation fails, the function launches an alert box to indicate the error as well as returns false. This return of false should stop the submit from taking place. On PC, this is working fine. However, on Mac, in both Netscape and IE, the page submits itself even though the validation fails.

How do we stop this submit from taking place? We're already returning false, I would have thought that would do it. Anyone ever seen this kind of behavior, or know how to fix it?
 
Hello,

I never had to use "false" for form validation.
Here is a piece of code I made for a recent site.
Hopefuly, you'll be inspired...:
[tested on MAC!!!]

function pass_infos() {

for (var i = 0; i < document.choice.elements.length; i++) {

if(your conditions here) {
alert('boo!');
return;
} else {

}
}

document.choice.submit();

}
My Work...
...and More...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top