/    Sign up×
Community /Pin to ProfileBookmark

Onclick and onsubmit event

I have a script that ensures that the email address field has been filled out and is valid, and is an ‘onsubmit’ action. I also have a script that stops the user from submitting the form multiple times, which is run via the ‘onclick’ event. By themselves these run fine, but when used together neither work. Why would this be?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayDec 11.2003 — Possibilities are endless, is there somewhere we can see the code?
Copy linkTweet thisAlerts:
@requestcodeDec 11.2003 — Not sure why, but why not run them both off of the onSubmit event? If we could see your code we might be able to help you further.
Copy linkTweet thisAlerts:
@ray326Dec 11.2003 — I'd roll it all into the onclick handler and submit from there if everything checks out. Oh, make sure your button is a "button" not a "submit".
×

Success!

Help @boolean01 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...