I hav created a group of textboxes using a loop and its names are unique and names are assigned using variable ( like ). Then How can i retrieve the values in that textboxes after a button click with in a loop. Really I cant move from here. Can anyone plz help me..
Part of the my code is given below
$q1="select * from result where s_id=$sid";
$res1=mysql_query($q1,$link) or die($q1);
echo '<form action="editresultprofile.php?sid=$sid">';
while($row1=mysql_fetch_assoc($res1))
{
echo '<td><input type="text" name='.$row1['sub_name'].' class="textfield" value='.$row1['result'].'></td>';
}
echo '<input type="submit" value="update" ></form>';
It is not possible through PHP. You have use javascript to get the values in the textbox at realtime.
But using php, you have submit the form first, and then only you will get the data on the page its submit the data too. For example as per your question, only
editresultprofile.phpwill be able to get the data values.On
editresultprofile.php, you can doHowever, if you use javascript, you can get the values as they were typed, before submitting the form.
Attach the function in the
onSubmitevent of the form.