Hello,
I have a form that is being generated on the fly in PHP using the below ($theFeatures
is a multidimensional array):
<?php
foreach($theFeatures as $theKey => $theValues) {
?>
<input type="text" value="<?php echo $theValues['Key']; ?>" name="theFeatures[<?php echo $theKey; ?>]['Key']" size="6" />
<input type="text" value="<?php echo $theValues['Value']; ?>" name="theFeatures[<?php echo $theKey; ?>]['Value']" /> <br />
<?php
}
?>
This should create two input boxes that look like this:
<input value="Type" name="theFeatures[4]['Key']" size="6" type="text" />
<input value="Bird Table" name="theFeatures[4]['Value']" type="text" />
How can I get the first part of the array ( [4]
in the above example ) in jQuery so I can store that as a JavaScript variable and use it else where in my jQuery??
Cheers,
Andy