im trying to use the code below to select a form element (i retrieve the values to validate the text)
$('#box1 [name=item[]]').val();
$('#box2 [name=item[]]').val();
i'm trying to get the value of the following
<form..>
<div id='box1'> <input type='text' name='item[]'/> </div>
<div id='box1'> <input type='text' name='item[]'/> </div>
</form>
I need to use 'item[]' with the square brackets [ ] because php can retrieve this data as an array
$data = $_REQUEST['item'];
Would return an array containing all the data in 'item'
The problem is the $('#box [name=item[]]').val() doesn't work, how would I get it to work or would there be another way to do this?