Closed Bug 298573 Opened 19 years ago Closed 19 years ago

The input type='button' submits my form.

Categories

(Toolkit :: Form Manager, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: metamorfozis, Unassigned)

References

()

Details

Attachments

(1 file)

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....:(
Just ran into this one myself.  FFox 1.0.6 on Win2K.
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
Closed: 19 years ago
Resolution: --- → INVALID
(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
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: