Closed Bug 67144 Opened 24 years ago Closed 24 years ago

[DUP]All whitespace in <option> value in <Select> trimmed

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 59248

People

(Reporter: norman, Assigned: rods)

References

()

Details

Attachments

(1 file)

431 bytes, text/html
Details
The whitespaces in the "value" attribute in <option> tag is trimmed to only 1 space when it is manipulated using javascript. Please see the example below: <HTML> <HEAD> <TITLE>Netscape 6</TITLE> </HEAD> <script language="javascript"> function showme() { alert(document.test.testoption[0].value) } </script> <BODY BGCOLOR="#FFFFFF"> <form name=test method=get action=Toy> <select name=testoption> <option value="The Space is Trimmed">The Space is Trimmed</option> </select> <input type=button value="Click Here" onclick=showme()> </form> </BODY> </HTML>
Attached file Testcase
Actually, this just seems to be a problem with the way alert() handles spaces. Try javascript:alert('a a a') The extra spaces get munged for me on linux build 2001-01-29-08.
Summary: All whitespace in <option> value in <Select> trimmed → All whitespace in <option> value in <Select> trimmed
I see the same munging on WinNT. Changing OS to "All". Since alert() is a DOM function, reassigning to DOM Level 0 for further triage. I don't see any problem in the stand-alone JS shell: js> print('a a'); a a
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: Javascript Engine → DOM Level 0
Ever confirmed: true
OS: Windows NT → All
QA Contact: pschwartau → desale
I am sorry that there is some mis-leading in my original post message. The javascript is one of the problem I faced .However, what I want to point out is that the whitespace in <option> value in <Select> is trimmed when submitting to server.
Component: DOM Level 0 → HTML Form Controls
Over to rods.
Assignee: jst → rods
Severity: critical → normal
Hardware: PC → All
This is adup from way way back
Status: NEW → ASSIGNED
Summary: All whitespace in <option> value in <Select> trimmed → [DUP]All whitespace in <option> value in <Select> trimmed
Indeed, this is a dup. *** This bug has been marked as a duplicate of 59248 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
I added a comment to bug 50348 about the alert() problem.
Verified Duplicate.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: