/    Sign up×
Community /Pin to ProfileBookmark

restrict submit on validation

Hi I have a third party form validation that I am running in an onClick event. The link of the button i am using is calling a submitForm() event.

This works fine. The onClick checks the form and the submitForm() does not run if the validation is not met, likewise it runs if it is.

I have added another script that submits the form if the user clicks the return key. However the validation script is not run when this happens, i guess because it is in the onClick event.

I have tried to combine the validate run script into the submitForm() function but this has not worked either.

[CODE]function submitForm(){
YY_checkform(‘EmpLogin’,’AccountNo’,’#q’,’0′,’Enter your Account Number please’,’CompPassword’,’#q’,’0′,’Enter your Password please’); return document.MM_returnValue;
if (document.MM_returnValue==true){document.EmpLogin.submit()}
}[/CODE]

What am I doing wrong?
Thanks
Ro

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @rotate spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...