Closed Bug 166913 Opened 22 years ago Closed 22 years ago

[FIX]Default label applied to <input> buttons with value=""

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.2beta

People

(Reporter: jonasj, Assigned: bzbarsky)

Details

Attachments

(2 files)

Build 2002-09-05-08, Win2k.

Steps to reproduce:
1) Open testcase.

Expected results:
* The submit and reset buttons with no value attributes get a default label.
* The buttons which explicitly sets value to "" gets no label.

Actual results:
* The buttons get the default label even when they have a value="" attribute.
Attached file Testcase
Testcase works correctly in: Opera 6.0, MSIE 6.0.
Testcase does not work correctly in: Mozilla 1.1, Mozilla build 2002090508.
The value is what gets put in the button.  If you have a value, we put it in the
button.  If you set the value to blank, therefore, we put blank in the button. 
Unless this is breaking some major topsite, we should do it right rather than
just copying other browsers.
> If you set the value to blank, therefore, we put blank in the button.

No we don't. If I set value to blank ("") on an <input type="submit">, we put
"Submit Query" in the button. Load the testcase and see for yourself.
Deepest apologies.  I read the summary wrong.  You are right.
Status: NEW → ASSIGNED
Attached patch Like this?Splinter Review
> +  if (value.IsEmpty()) {
> +    // Have to have _something_ or we won't be drawn
> +    value.Assign(NS_LITERAL_STRING("  "));

That won't cause "  " two be submitted with the form, will it?
No.
Comment on attachment 98113 [details] [diff] [review]
Like this?

r=jkeiser
Attachment #98113 - Flags: review+
Comment on attachment 98113 [details] [diff] [review]
Like this?

sr=jst
Attachment #98113 - Flags: superreview+
taking.
Assignee: jkeiser → bzbarsky
Status: ASSIGNED → NEW
Priority: -- → P3
Summary: Default label applied to <input> buttons with value="" → [FIX]Default label applied to <input> buttons with value=""
Target Milestone: --- → mozilla1.2beta
fixed for 1.2b.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: