Jump to content

Multiple Submit Buttons In A Form


kelleydl
 Share

Recommended Posts

I have a form which on submit click sends information to post.php which checks the information and then adds it to the database. after that it goes back to the main page and prints out the database onto my index.php in a table. i was hoping to have 2 submit buttons that would do different things when clicked. but i dont know how to do that.. can anyone send me in the right direction with this? the action can either be sent to post.php or stay in index.php where the submit buttons originally are

Link to comment
Share on other sites

You would need an intermediate page to determine the name of the button that was clicked, or you could use javascript to change the action as the button press happens. Or just roll all of the stuff that happens in the possible target pages into one, branched depending on which submit button was pressed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...