By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

javascript onclick event on submit button- why does this happen?

P: n/a
I created a "cancel" button for my form at the clients' request, I
accidentally copied a submit button and added an OnClick event- a very
simple javascript.history function. It did not appear to work at all-
it kept submitting the form. I changed the submit button to a plain
old button and it worked fine.

Can anyone explain how the browser works with a javascript onClick
event ona submit button? Does it automatically submit the form no
matter what onClick event you use?

Thanks,

Don

Oct 6 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
bjc
The onClick event allows you to program in some conditional program
code; checking for errors etc. Ultimately it will submit the form.

Oct 6 '05 #2

P: n/a
bjc said the following on 10/6/2005 10:41 AM:
The onClick event allows you to program in some conditional program
code; checking for errors etc. Ultimately it will submit the form.


It is easier to see what you are referring to if you quote what you are
replying to.

The submit button will ultimately submit the form as long as nothing
stops it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 6 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.