Closed Bug 178500 Opened 22 years ago Closed 22 years ago

Option Javascript object truncates whitespaces in text field

Categories

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

x86
Windows XP
defect
Not set
blocker

Tracking

()

VERIFIED DUPLICATE of bug 30471

People

(Reporter: mcosta, Assigned: jst)

Details

When you create a Option javascript object on the client side with text and 
value as parameters to the constructor, the value of the text property is 
striped of whitespaces and reduced to just one whitespace character.

for example:

On the clientside javascript

//create Option Object with text and value as parameters to the constructor.

Option option = new Option("some       text    with    whitespace    
characters","someval");

//this alert will display "some text with whitespace characters"
alert(option.text);

extra whitespaces have been ignored.

Could you please provide a solution to this.
I have tried Unicode escape sequences as well as a css entry such as 

<style type="text/css">
option p{ white-space:pre;}
</style>

but nothing seems to work.

Thanks in advance for your help
Malory
Browser, not engine ---> DOM Level 0

This is an adjunct or duplicate of bug 30471,
"Leading spaces not displayed when adding Options to Select box"
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
QA Contact: pschwartau → desale
cc'ing jkeiser, peterv

Should we resummarize bug 30471 to include whitespace stripped anywhere
in the Option, not just leading whitespace? If so, this bug is a straight
duplicate.
It's a straight duplicate no matter what... resummarizing may be a good idea.

*** This bug has been marked as a duplicate of 30471 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
v.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.