2 buttons in a form ?

F

franck

Hi,
I would like to have 2 buttons in the same form and each button have an
different action.
by example:
One button is to "Preview the request"
The other is to "Confirm the request"


Thank you
Franck
(Paris-france)
 
W

Weyoun the Dancing Borg

franck said:
Hi,
I would like to have 2 buttons in the same form and each button have an
different action.
by example:
One button is to "Preview the request"
The other is to "Confirm the request"


Thank you
Franck
(Paris-france)


well have 1 button submit to a DB or pl file to "submit" the form, and
the other to store the information temporarily and spew it out in
pph/asp or cgi file and then that page has a submit...
 
K

Kim André Akerø

franck said:
Hi,
I would like to have 2 buttons in the same form and each button have an
different action.
by example:
One button is to "Preview the request"
The other is to "Confirm the request"

Try something along the lines of this:

<input type="submit" name="action" value="Preview the request" />
<input type="submit" name="action" value="Confirm the request" />

Only the value of the submit button the user has clicked will be sent along
with the other form data, so it's just a matter of checking in your script
code which value has been passed for the name you gave your submit button
(in the example, the form field "action").
 
F

franck

Sorry but my question was bad.

I have a form like this:

<form name="form1" method="post" action="send_email_groupe.php">
<textarea name="contenu" cols="100" rows="20"></textarea>
<input type="submit" name="Submit" value="Modifier">
</form>

You can see that there is only ONE action possible for this form. It is
"send_email_groupe.php"

Then, I would like to have 2 actions into the same form with 2 buttons
inside (One to prewiew and the other to confirm).
I hope you anderstand me because my English is not very good.

How to do that.
Thank you.
Franck
 
S

Steve Pugh

franck said:
I have a form like this:

<form name="form1" method="post" action="send_email_groupe.php">
<textarea name="contenu" cols="100" rows="20"></textarea>
<input type="submit" name="Submit" value="Modifier">
</form>

You can see that there is only ONE action possible for this form. It is
"send_email_groupe.php"

Then, I would like to have 2 actions into the same form with 2 buttons
inside (One to prewiew and the other to confirm).

So modify send_email_groupe.php to do different things depending on
which button was pressed (obviously you need to give the two buttons
different names).

Steve
 
F

franck

Thank you !!
I didn't know that the name of the button was trasfer as parameter to the
target URL.

Thank you, that's works.
Franck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top