php - submit button that will submit the form and send a email? -
i have form has 2 buttons on it. 1 send email using .php script,and submit form .php database. both of these work great themselves, combine them 1 button. here example of code:
<form name="drop_list" action="<?php echo $editformaction; ?>"" method="post" > <input name="emailform" type="button" id="emailform" onclick="sendformemail()" value="email"> <input name="add_patient" type="submit" id="add_patient" onclick=document.drop_list.action='<?php echo $editformaction; ?>' value="add patient"> here java script run email button:
function sendformemail() //email form { document.drop_list.action = "html_form_send.php"; document.drop_list.target = "_blank"; document.drop_list.submit(); // submit page return true; } i still new php script , javascript, appreciated.
just use mail(to,subject,message,headers,parameters) in send email function. function arguments have strings store text of form fields, can fill mail() function email , other data inserted in user interface.
check know how call function declared in same file calling particular php function on form submit
Comments
Post a Comment