SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: jQuery filters anyone?
-
Jan 15, 2008, 19:20 #1
- Join Date
- Dec 2004
- Location
- Canada
- Posts
- 162
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
jQuery filters anyone?
I have some form fields which are named in such a way as to be submitted as an array, thus:
<input type="text" name="my_fields[]" />
<input type="text" name="my_fields[]" />
<input type="text" name="my_fields[]" />
etc.
I am trying to access these fields using jQuery:
$('#myform').find('input').filter('[name=my_fields[]]');
Unfortunately this seems to ignore the filter completely because of the square brackets. I have tried escaping them with back-slashes, but to no avail.
Any ideas?
-
Jan 16, 2008, 00:26 #2
- Join Date
- Jun 2004
- Location
- Mumbai, India
- Posts
- 541
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have not used jQuery filters but in XSL the following xpath query works fine
/input[@name='my_fields[]']
I am not sure but try this
$('#myform').find('input').filter('[name="my_fields[]"]'Vikrant Korde
S Y S T I M E, Mhape,
Mumbai, Maharashtra, India.
-
Jan 16, 2008, 13:07 #3
- Join Date
- Dec 2004
- Location
- Canada
- Posts
- 162
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Bookmarks