I am new here and i trying to make some PHP page working but failed miserably. I am not very good with logic nor PHP, so please bear with my stupid question and my messy codes :)
I have array of textboxes with value and there are array of buttons next to it. what i want is each button capture specific value what i typed into the corresponding textbox
here's the piece of my code
<?php
$data = mysql_query("SELECT * from tempimg");
while($hasil = mysql_fetch_assoc($data)){
$i++;
echo "<tr>
<td align=center><input type= checkbox name=check[] value=$hasil[idFoto]</td>
<td align=center><img src=$hasil[thumbPath]></td>
<td align=center>$hasil[imgName]</td>
<td align=center>$hasil[thumbPath]</td>
<td align=center>$hasil[Path]</td>
<td align=center>
<input type=text align=center value=$hasil[imgLink] name=link[{$hasil['idFoto']}] id=link />
<td align=center>
<button type=submit onClick=\"return confirm('you clicked button with ID: $hasil[idFoto] '+'value: '+(document.getElementById('link').value))\">
<img src=images/sav.png alt=search-btn id=img />
</button>
</td>
<td align=center><img src=images/del.png></img></td>";
}
?>
and here's the link of image for the PHP page I'm talking about
so I humbly request of help from people here, please help me.
EDIT: thanks to Mr. Barmar i manage to pop out the value of the text box inside the dialog box with the corresponding button,
here a new question, how to save the value from the text box that i got from clicking the corresponding button into the database?
or more simple, how to capture the value from the text box by using the button next to it and then post it on the screen using "echo"