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

onsubmit check in netscape?

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
US
Hi I want to do a check of the form fields on submit but it seems to work for IE but not for netscape.

Actually I am not checking at all in the function..

I do a confirm (are you sure?) and on ok do a return true else return false and in IE, when i click cancel it doesnt go ahead with the submit but in netscape it goes ahead even if i hit cancel..

Thanks.
 
Code?
Also try forum216 if you don't get any responses.

--Chessbot

"Violence is the last refuge of the incompetent." -- Asimov, Foundation
 
Without seeing more of your code, my only guess would be that you're not returning the return value. This is the most common problem. Make sure your form tag looks something like this:

Code:
<form name="f" ... onsubmit="return confirm('are you sure?');">

This will prompt the user, and if the user clicks cancel or x's out of the confirmation box, false is returned to 1) the call to confirm() and then, false gets returned to the onsubmit function.

This will prevent the form from submitting unless the user hits "Ok".

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
What? So you're telling me that even though you have that code in the onsubmit event, it submits anyway?

We'll need to see your code then...

Sounds like an odd problem.

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top