Using onsubmit() in javascript

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Using onsubmit() in javascript

Post by kendall »

Hello,

I wasnt sure what to search for concerning my query so i am posting a topic.

I am developing my own custom form validator which is triggered by the submit buttons onClick. my form actions attribute is set to null to avoid submission.

the process here is that on the submit buttons onclick triggers the form validator to calidate the form. on validation it submits but on error i trigger an alert and exit the function.

when i test this out...when exiting the "alert prompt" the form continues on with the submission.

I have researched one of dreamweavers javascript extension and note that a "return document.MM_returnValue" being used.

Can someone offer me some explanation in triggering the form.onsubmit(); from within javascript code rather than on the submit button and why is my form still being submitted?

Kendall
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Code: Select all

<INPUT name=&quote;submit&quote; type=&quote;submit&quote; onClick=&quote;myFunction();return false;&quote;>
Post Reply