Monday, March 26, 2007

difference about quotes and non-quotes in HTML select

I usually use a computed value with a dbcolumn to display values in a combo (the select HTML tag)
Suppose your returned HTML source looks like this:

<select id="mySelect" >

<option value=value 1>entry 1</option>

<option value=value 2>entry 2</option>

<option value=value 3>entry 3</option>


This bad ... the value attribute of should always be surrounded by quotes. Otherwise, jQuery will return only 'value' in IE (read that this is acceptable for FireFoxie, didn't verify, though)

So, always add an extra \" into my computed values, so that I will get:

<select id="mySelect" >

<option value="value 1">entry 1</option>

<option value="value 2">entry 2</option>

<option value="value 3">entry 3</option>


hmm, talk about little difference which wasted an hour of my time ... doh
Post a Comment

Disclaimer: The information in this weblog is provided "AS IS" with no warranties whatsoever, and confers no rights to any institution/person/organization. These are my personal thoughts and ideas. When I am inspired by others I give credit, I do not assume other's work and efforts. This site is NOT supported, approved, blessed etc. by Lotus Software and/or IBM Corporation.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 License.