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

B

bbcrock

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
 
B

bjc

The onClick event allows you to program in some conditional program
code; checking for errors etc. Ultimately it will submit the form.
 
R

Randy Webb

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top