i have retrieved a record from mysql table using php. Each record is retrieved with a form and a delete button. the user is supposed to click the delete button and then the record on that row is deleted. Problem is i want to display an alert before deletion, how do i do this since the record to be deleted has an ID stored in a hidden field inside each form. my retrieved table below;
echo'<tr><td>'.$sn.'</td>
<td>'. htmlspecialchars($r['Year']).'</td>
<td><form method="post" action="awardyear.php">
<input type="hidden" name="yearId" value="'.$r['YearID'].'"/>
</form>
</td>
<td><form method="post" id="awardForm" action="awardyear.php">
<input type="hidden" name="yearId" value="'.$r['YearID'].'"/>
<input type="submit" name="deleteYear" class="btn btn-danger" value="Delete">
</form></td>
</tr>';
Any help will be appreciated, thanks.