The input type='button' submits my form.

VERIFIED INVALID

Status

()

Toolkit
Form Manager
VERIFIED INVALID
13 years ago
10 years ago

People

(Reporter: MetaMorfozis, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Hi, I'm from hungary, and my english grammar is very bad.
So I have a forum and the forumhave an "Add post" section. This section's form
have a SUBMIT "mehet!" and a preview "Előnézet" button. (The RAR file contains
this page saved version.) So, the Előnézet (preview) button type is _button_ not
submit but when i pressing down the form onsubmit action is activated and
firefox(and netscape) try to submit the form. So the problem 80% in my page. But
it's work under opera and ie, i have other plugins in my firefox but i ask for
test my friends and the problem isn't solved.

Reproducible: Always

Steps to Reproduce:
1.push the "Előnézet" button.


Actual Results:  
Check the msg is showed: "Kérlek mielőtt..." this msg is in the form onsubmit
action accordingly the type='button' submitted the form. :( The "előnézet"
button's have only one function, this is preview(); the preview fn opens a
window it's contains your msg replaced the bbcode and smilies etc... so the
problem is this button SUBMIT the form....:(

Comment 1

13 years ago
Created attachment 192768 [details]
Simple test case showing the bug

Comment 2

13 years ago
Just ran into this one myself.  FFox 1.0.6 on Win2K.

Comment 3

13 years ago
I don't know about the orginal report, as I don't have a utility to open the rar
file, but the test case is invalid, and works exactly as expected.  <button>
elements work like normal submit buttons unless you set the type to be 'button'
(it's submit by default)
See reference: http://www.w3.org/TR/html4/interact/forms.html#h-17.5
MetaMorfozis: if you're still with us: the problem is that you have a <label>
around both the submit and the preview buttons, roughly

<label><input type="submit"><input type="button"></label>

We don't handle that very well, and we've got bugs for that, but doing that is
*not* what you want to do: a label is something that transfers clicks to the
form control that goes with the label (which for us is the first control, the
submit button), so it just doesn't make any sense to have a label that only
contains two different buttons that do different things. It doesn't do you any
good, and makes us pass the click on the preview button on to the submit button.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → INVALID
(Reporter)

Comment 5

12 years ago
(In reply to comment #4)
> MetaMorfozis: if you're still with us: the problem is that you have a <label>
> around both the submit and the preview buttons, roughly
> 
> <label><input type="submit"><input type="button"></label>
> 
> We don't handle that very well, and we've got bugs for that, but doing that is
> *not* what you want to do: a label is something that transfers clicks to the
> form control that goes with the label (which for us is the first control, the
> submit button), so it just doesn't make any sense to have a label that only
> contains two different buttons that do different things. It doesn't do you any
> good, and makes us pass the click on the preview button on to the submit button.


Thank you, I'm solved the problem other way, but thank you.
Status: RESOLVED → VERIFIED
(Assignee)

Updated

10 years ago
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.