tags:

views:

195

answers:

2

I am trying to use Jquery to iterate through an array of textboxes where i only want textboxes that are 'enabled'. can someone give me the best way to do this? Would i use the filter method ?

(ie:)

var arrayOfTextBoxes = $("[id$='" + textBoxId + "']");

var enabledTextBoxes = $(arrayOfTextBoxes).????

Thanks!

+2  A: 

Use the :enabled selector.

//this will find the checkbox if it is enabled
$("#"+textBoxId+":enabled")
geowa4
thank you!that was so easy im embarrassed...
29er
no problem, i've seen worse.
geowa4
A: 
$(arrayOfTextBoxes).filter(':enabled')

or

$("[id$='" + textBoxId + "']:enabled")

in the first place.

chaos
ohh nice, i've got a couple of ways to do this.Thanks!!
29er