473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Firefox option indentation

Hi

Can anybody tell me why this doesn't work in Firefox?

sel.options[sel.options.length] = new Option("\u0020\u0020-
\u0020\u0020Option 1", 1);

Basically I'm trying to indent some options but Firefox refuses to
show those spaces!

Thanks for any help.

Jun 27 '07 #1
4 1683
On Jun 27, 11:03 am, nick <wass...@gmail.comwrote:
Hi

Can anybody tell me why this doesn't work in Firefox?

sel.options[sel.options.length] = new Option("\u0020\u0020-
\u0020\u0020Option 1", 1);

Basically I'm trying to indent some options but Firefox refuses to
show those spaces!
Nothing to do with javascript, but anyway... use &nbsp; or an optgroup
element.

<URL: http://www.w3.org/TR/html4/interact/...#edef-OPTGROUP >
--
Rob
Jun 27 '07 #2
On Jun 27, 2:31 pm, RobG <r...@iinet.net.auwrote:
On Jun 27, 11:03 am, nick <wass...@gmail.comwrote:
Hi
Can anybody tell me why this doesn't work in Firefox?
sel.options[sel.options.length] = new Option("\u0020\u0020-
\u0020\u0020Option 1", 1);
Basically I'm trying to indent some options but Firefox refuses to
show those spaces!

Nothing to do with javascript, but anyway... use &nbsp; or an optgroup
element.
&nbsp; doesn't get interpreted at all with dynamic option.text
assignment (I know it works for static html), and optgroup is not
practical for what I intend to do.

Jun 27 '07 #3
nick a écrit :
Can anybody tell me why this doesn't work in Firefox?

sel.options[sel.options.length] = new Option("\u0020\u0020-
\u0020\u0020Option 1", 1);
Give a try to : \u00a0

--
laurent
Jun 27 '07 #4
On Jun 27, 10:01 pm, Laurent vilday <mok...@mokhet.comwrote:
nick a écrit :
Can anybody tell me why this doesn't work in Firefox?
sel.options[sel.options.length] = new Option("\u0020\u0020-
\u0020\u0020Option 1", 1);

Give a try to : \u00a0
You are a f**king genius!! Thanks heaps man!

Jun 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: McKirahan | last post by:
Firefox does not reflect selected option via innerHTML How do I get Firefox to reflect selected option values? <html> <head> <title>FFinner.htm</title> <script type="text/javascript">...
7
by: CFonville | last post by:
I have a script that is working fine in the latest version of Firefox with no errors or warnings, but does not work in IE. I have several select boxes that, when changed, update some text (a...
5
by: VK | last post by:
On the demo at <http://www.geocities.com/schools_ring/tmp/demo01/index.xml> the table caption has 1px(?) indentation from the left in Firefox 1.5 and I'm running out of ideas how to kill it - if...
2
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical...
11
by: davecph | last post by:
I'm constructing a website with a layout created with div-tags. They have a fixed width, float left, and display inline. When one of the div's contain a select-element the right-most div floats down...
4
by: Sjef Janssen | last post by:
Hallo, I'm trying to create boxes that have nicely spaced paragraphs, but a title that is in a colored line full-width. Here is my styles: In the div content I create the framed boxes and...
5
by: Richard Maher | last post by:
Hi, Can someone please show me how to tell Firefox to preseve white-space when returning the selectList.option.value attribute? I have change the style so that the white-space is preserved on...
2
by: firstexact | last post by:
Hi guys, First post, hope you can help, I have done two sites www.trisant.co.uk and my own www.firstexact.co.uk. The 2 x 2 grid I originally envisaged goes haywire in Firefox as I get a 4 high by...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.