Some browsers return value="" when the options themselves don't have value
attributes. Unfortunately I'm pretty sure $(this).val() won't solve the
problem. You can however do something like this:
var selitem = this.value || this.options[this.selectedIndex].text;

I.e. set selitem to value if it exists or to the the text of the selected
option if it doesn't

Blair

On 11/28/06, Clodelio Delfino <[EMAIL PROTECTED]> wrote:

Hi All,

Need help in displaying the selected value on a select in a
form....below is the code which return nothing/empty.

$("#frmLookup select").change(function() {
    var selitem = this.value

    alert(selitem)
})

form:
<form id="frmLookup">
<select>
<option>choice1</option>
<option>choice2</option>
<option>choice3</option>
</select>
</form>

Thanks in advance...Cheers,
cdelfino


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to