Closed Bug 187075 Opened 23 years ago Closed 23 years ago

If I click on a button declared with BUTTON tag for run javascript, associated with onClick event, the form is submitted.

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jk, Assigned: alexsavulov)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130 If I click on a button declared with BUTTON tag for run javascript, associated with onClick event, the form is submitted. The form has to be submitted only after click on INPUT type=submit. Reproducible: Always Steps to Reproduce: 1. Create HTML page with a form. 2. Insert in the form a BUTTON tag with script in onClick event. 3. Open the page in Mozilla and try execute the script. The form is submitted.
According to bug 141563 comment 3, this is due to a bug in IE. You should give a 'button'-type to your button, otherwise it's automatically a submit-button. IE has a wrong default type.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.