I have a textbox array in my form. The textbox(s) are dynamically added using javascript function.
The text box are named as below:
account[0]_number account[0]_balance
account[1]_number account[1]_balance
How can I get the values of these textboxes using jquery?
Below is how I tried, but it gives error:
if($('#account[' + iteration + ']_balance').val().length==0)
You could try:
I’m not sure if you’re referring to
nameorid, if you are referring to name, then modify the selector toinput[type=text][name^=account][value].Also,
[value]will only match non-empty elements with avalueattribute.See http://api.jquery.com/attribute-starts-with-selector/
EDIT this should do it: