Forum Moderators: coopster

Message Too Old, No Replies

1 form 2 form actions.how?

how to have 1 form and 2 submit buttons?

         

Jaunty Edward

11:27 am on Oct 5, 2005 (gmt 0)

10+ Year Member



Hi friends,

I have this situation where I think most of you have already been before. I have one form where I have to have these two submit buttons:

1. Submit to file1.php - Perform some operation.
2. Submit to file2.php - Delete the entries.

I understand that I can do this with JavaScript by putting onclick event and settings the form action accordingly....but is there any other way to do this?

Please help.

Thanks
Bye

dreamcatcher

12:05 pm on Oct 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<input type="submit" name="update" value="Update">
<input type="submit" name="delete" value="Delete">

Then:

if (isset($_POST['update']))
{
//do something
}
if (isset($_POST['delete']))
{
//do something
}

Hope that helps.

dc