Jump to content

2 button in 1 form


robert_gsfame

Recommended Posts

I am really confused with this, hope someone could help..

 

let say i have 2 button in one form, first button i will use to do the submission while the other one will be used to send an email to user's email typed in the textbox..how to do it using javascript??

 

<form name = " form1" action="POST">

<input type = "submit">

<input type="text" name="user_email">

<input type="button">

</form>

 

What should i do with the button??

 

Link to comment
https://forums.phpfreaks.com/topic/175338-2-button-in-1-form/
Share on other sites

Hi robert_gsfame,

 

What you are proposing is not possible, there is no way to email form data using Javascript.

 

You would be better off having a checkbox on your form, something like "Email me a copy", then in your PHP code have an if statement which essentially says if checkbox is checked, send email to email address.

 

Hope this helps.

Link to comment
https://forums.phpfreaks.com/topic/175338-2-button-in-1-form/#findComment-924021
Share on other sites

Archived

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

×
×
  • 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.