Jump to content

Multiple Submit Buttons In A Form


kelleydl

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...