473,407 Members | 2,326 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,407 software developers and data experts.

FireFox: ComboBox

Anyone know how to write select in HTML to make firefox "select" an item?


[HTML]
<select id="something" name="something">
<option value="1">one</option>
<option value="2" selected>two</option>
<option value="3">three</option>
</select>
[/HTML]

of coarse, by looking at it, anyone would assume that "Two" will be the selectedIndex. however, in firefox it seems to be ignored. :\

i've also tried selected="selected" to be W3C compient, and selected="true" and in all cases, IE works, and FireFox ignores.

thoughts?
Thanks
Echo

/FireFox 2.0.0.4
Jul 3 '07 #1
9 4303
gits
5,390 Expert Mod 4TB
hi ...

i cannot see this problem ... tested your select-markup with a 2.0.0.3 on mac and 2.0.0.4 on win ... they do it right ... (used selected and selected='true' too)

kind regards
Jul 3 '07 #2
actually, it looks like it has something to do with FireFox attempting to be helpful and holding onto the selection from the last page load :\

blah... thanks though
Jul 3 '07 #3
drhowarddrfine
7,435 Expert 4TB
Works fine for me, too.
Jul 3 '07 #4
xNephilimx
213 Expert 100+
Works fine for me, too.
Yeah, for me too.
But the correct way to do it is this: selected="selected", not "true".
That's the W3C standard for it, try it, it should work. Anyway, for me, it works in any of the ways mentioned.
Jul 4 '07 #5
gits
5,390 Expert Mod 4TB
Yeah, for me too.
But the correct way to do it is this: selected="selected", not "true".
That's the W3C standard for it, try it, it should work. Anyway, for me, it works in any of the ways mentioned.
;) now we have to clear that ... since you instist on a w3c-standard.

first have a look at the w3c-html4-spec:

w3c HTML4 - attribute 'selected'

that states that when the boolean attribute 'selected' is set for an option ... this should be preselected. so with that you may set the attribute without a value or with a value whatever you want ... it only has to be set.

when you have a look at the XHTML-DTD then you are right ...

XHTML 1.0 - strict

when you set the attribute 'selected' its value must be 'selected' too ...

in either way it works as a 'boolean'-attribute ... when set it causes preselection and when not set ... nothing happens ;)

kind regards ...
Jul 4 '07 #6
xNephilimx
213 Expert 100+
;) now we have to clear that ... since you instist on a w3c-standard.

first have a look at the w3c-html4-spec:

w3c HTML4 - attribute 'selected'

that states that when the boolean attribute 'selected' is set for an option ... this should be preselected. so with that you may set the attribute without a value or with a value whatever you want ... it only has to be set.

when you have a look at the XHTML-DTD then you are right ...

XHTML 1.0 - strict

when you set the attribute 'selected' its value must be 'selected' too ...

in either way it works as a 'boolean'-attribute ... when set it causes preselection and when not set ... nothing happens ;)

kind regards ...
Yepp, you're right, I'm used to code in xhtml 1.0 Strict.
Jul 4 '07 #7
drhowarddrfine
7,435 Expert 4TB
since you instist on a w3c-standard.
Who doesn't? All markup MUST be.
Jul 4 '07 #8
gits
5,390 Expert Mod 4TB
Who doesn't? All markup MUST be.
of course ... but the two i mentioned are different, and when you say 'the w3c standard' ... then you should mention which one you mean ... HTML/XHTML etc. ... as i said ... when you write your code according to HTML-spec ... then its valid to put whatever value to the 'selected'-attribute you want ... even if you put no value at all ... its valid ... in case of XHTML it is not ;) ... then it has to be 'selected' too ... and using the w3c as proof ... you should be more precise as we can see ...

kind regards ...
Jul 4 '07 #9
xNephilimx
213 Expert 100+
actually, it looks like it has something to do with FireFox attempting to be helpful and holding onto the selection from the last page load :\

blah... thanks though
I'm sorry, I totally missed this response!
And yes, when you refresh a page in Firefox, all inputs remain as the time before the refreshing, but IE clears all out.
I don't know if there's a way to override that functionality in Firefox, anyway I really find the Firefox way more usefull when testing things with forms, so I don't have to fill it up over and over again, specially in large forms. ;)

See ya!
Jul 4 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
2
by: gabe garza | last post by:
This isn't a ASP.NET question, more of a HTML code question. I noticed that on Safari and Firefox on a MAC that when tabbing thru controls that it bypasses a combobox, but with IE on the MAC I...
0
by: Supra | last post by:
in netscape or firefox browser.........do u know what is combobox 's control ...the one with comes with icon.
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
3
by: 9DeT | last post by:
The javascript works perfect on IE, but on firefox it doesnt. I've pasted both frames source, as well as the page source ( the right frame source.txt was zipped to fit the maximum size allowed)...
6
by: shailen21 | last post by:
Hi everybody, Im trying to use that piece of javascripts for 2 combo box in my web site but its nt working on Firefox but it works well in IE 6.0 :S Can someone please help me in solving this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.