You have a space between form and [name=...] . In CSS a space is a
descendant selector, so it's expecting some descendant of the form to
have a name equal to formName. Remove the space and you should be fine.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Oct 11, 2009, at 5:12 PM, zephyr wrote:
Hi,
I have a form and want to select a text input element _in that
specific form_. This is my code:
$("form [name=" +formName + "] :text[name=" +textInputField+ "]"))
formName: a form in my document
textInputField: a <input type="text"> in my document
If I do this
alert($("form [name=" +formName + "] :text[name=" +textInputField+
"]")).length)
I get 0
If I do this
alert($(":text[name=" +textInputField+ "]")).length)
I get 1
I have no idea what I am doing wrong...