Welcome to the joys of cross-browser web development.
Blair On 11/28/06, Clodelio Delfino <[EMAIL PROTECTED]> wrote:
Thank you Blair, i made some changes on <option> to have <option value="choiceX">...it's working now(FF/IE). Btw, before...in firefox it's working without the need for "value"...whereas in IE6, it doesn't. Cheers, cdelfino Blair McKenzie wrote: > 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] > <mailto:[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] <mailto:[email protected]> > http://jquery.com/discuss/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
