I tried searching for the answer to this, but did not find the specific answer I was looking for. In mootools, how do I access a form input element like below that has an array name using the "double dollar" ($$) function to be able to iterate through for form validation.
<input name="field[inventory_id]" type="text" />
<input name="field[asset_tag]" type="text" />
<input name="field[idea_tag] type="text" />
<input name="field[equip_make]" type="text" />
<input name="field[equip_model]" type="text" />
etc...
Thanks
Dan B
In MooTools you can use for example:
This will get you all the
input
elements that have aname
attribute starting with "field".You could combine with that a
.filter()
with a funcion for validating and check in the end `the length property of this elements collection. Something like:jsFiddle: http://jsfiddle.net/kthaqmL2/