[SOLVED] Multiple Buttons on One Form
Posted: Thu Aug 19, 2004 12:58 pm
I have a form called Schedule, and I have 2 button on the form. Each button needs to do something different. I read somewhere that you can call the forms action in the onClick part of the button but it's not working for me. Can someone tell me what I'm doing wrong or how to have to different actions for different buttons. Below is my code.
I'm not receiving any errors but when the addnote button is pressed nothing happens.
Code: Select all
<?php
echo '<tr bgcolor="#FFFFFF"><form name="schedule" action="" method="post"><td width="10%" bordercolor="#000000" >'. $date. '</td>';
echo ("<td width='21%'><a href='itschedule_edit.php?priority=".$id."'>".$description. "</a></td>");
echo '<td width="34%">' .$strnotes.'<input type="Text" name="txtNote'.$id.'" size="70%"> ';
echo '<input type="submit" name="addnote'.$id.'" value="Insert" onClick=this.form.action="itschedule_edit.php?id='.$id.'"></td>';
echo '<td width="8%" align="center">' .$percentComplete. '%</td>';
echo '<td width="5%" align="center">' .$Completed. '</td>';
echo '<td width="10%">' .$datecompleted. '</td>';
echo '<td width="10%">' .$dateverified. '</td>';
echo '<td width="2%"><input type="submit" name="update'.$id.'" value="Edit">';
echo '</form></tr>';
?>