1 Form using 2 Submit Buttons

I have a form and need to have 2 submit buttons on it and depending upon which button (both for updates) is pressed the database will update accordingly.
Dreamweaver won't allow this, and I don't know where to start.

Can someone point me in the right direction?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can't have two submit buttons.

What EXACTLY are you trying to do?
Benno2805Author Commented:
It's information entered by the client and it can be modified or made inactive. Depending on which button is pressed, one will do the modifications, the other will make the record inactive both via Updates.
Benno2805Author Commented:
OK, I've thought that it may be easier doing it with radio buttons and if RadioButton1 is active then 'do this update' if radionbutton2 is active then do this update...

But I don't know how to put it in the code, especially since Dreamweaver puts in a lot of stuff you don't really need.

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Ryan ChongCommented:
You need to have a form onsubmit event, where it will set to call a javascript function to check which radio button you have selected, and then determine what action (we can change the form's Action just before the posting) to take, clear?

Post your code here if necessary, so that we can help you amend it.

You could create 2 update 'command' pages, one for each button.  Each button would simply need to be a link to the correct command page.  Pass the parameters to each command page for the update via Request.Form. Have the command pages redirect back to the form page (or where ever you need the user to go).  You will need to add the Response.Redirect line to each command page manually.  To the user, this works virtually seamlessly.  

There only needs to be one 'receiving' page - you can just have a value added to the form according to which button you press, to tell the receiving page what to do with the data. How about this:

function doModify() {
<form name="myForm" action="update.php" method="post">
<input type="hidden" name="mod" id="mod" value="0"></input>
<input type="submit" name="inactive" value="Make data inactive"></input>
<input type="button" name="update" value="Update data" onclick="doModify();"></input>

Then your receiving page (it could even loop back to this page if you wish) can be coded to do the update if the form variable mod=1, and deactivate it if mod=0.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Benno2805Author Commented:
Thanks guys, I took a little bit of advice from each of you and i've come up with a clean, reliable solution.

Thanks again.
That's great Benno2805.  Glad things worked out for you.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.