Trying to link two fields on a POST by getting the ID.
Each 'songfld' has a unique number as below. The textarea is linked on that number.
The form fields:
<input type="text" name="songfld[901]" value="">
<textarea name="data[901][name]" id="txt-901" rows="2" cols="80"></textarea>
<input type="text" name="songfld[902]" value="">
<textarea name="data[902][name]" id="txt-902" rows="2" cols="80"></textarea>
And trying to get the 901 & 902 ID's here:
foreach($_POST['songfld'] as $val){
$val is the value from input
$id = $_POST['songfld'][0]; // the number in each name="songfld[X]"
$namefld = $_POST['data'][$id]['name']; // gives the value from textarea
echo "<P>$id $idfld $namefld";
}
Of course the value passes, but I'd like to have that unique number from each post as well.
hope someone knows this trick.