Jump to content

whats the best way to handle multiple submit buttons on forms


CincoPistolero

Recommended Posts

I have a page that loads form order data from several database tables. From that page, i'd like to do two different things. 1) send form info to a page that deactivates order 2) send form info to a page that adds everything selected to a work order table.

 

I've tried the code below to send to different pages but the location.replace does not pass the form data.

 

<?php
if (isset($_POST['deact'])) { // if form has been submitted 
?>
  <script language='javascript'>
location.replace('deactivate.php?artistID=<?php echo $row['artistID']; ?>');
</script> 
<?php } else if(isset($_POST['accept'])) { ?>
<script language='javascript'>
location.replace('acceptSubmission.php?artistID=<?php echo $row['artistID']; ?>');
</script>
<?php } else { ?>
<div id="main">

 

How else is it possible to have two buttons that can act on all of the form data?

 

thanks in advance

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.