[jQuery] Re: Getting the value of a select option by it's text

2007-05-01 Thread Klaus Hartl
David schrieb: Hi, I have an odd problem that I'm trying to solve with jQuery. I have select box with multiple options. Each of the options has a value, which is a database id, and text which is what is displayed in the select box, e.g.: Please select: --- Phone me fo

[jQuery] Re: Getting the value of a select option by it's text

2007-05-01 Thread Jörn Zaefferer
David schrieb: Hi, Thanks for the suggestion Jorn. That didn't work for me at first, it just returned me the object I already had, ie. the select element. But when I changed the selector to "#payment_method option" the magic started to happen. That makes sense, glad I could help. -- Jörn Z

[jQuery] Re: Getting the value of a select option by it's text

2007-04-30 Thread David
Hi, Thanks for the suggestion Jorn. That didn't work for me at first, it just returned me the object I already had, ie. the select element. But when I changed the selector to "#payment_method option" the magic started to happen. Thanks again, David Jörn Zaefferer wrote: David, Can anyon

[jQuery] Re: Getting the value of a select option by it's text

2007-04-30 Thread Jörn Zaefferer
David, Can anyone think of a way I can do this with jQuery? have you check the contains method? http://docs.jquery.com/DOM/Traversing#contains.28_str_.29 That should work for your case. -- Jörn Zaefferer http://bassistance.de