Add Two Submit Buttons
Add Two Submit Buttons
Hi all,
Am new to Jquery. I have two submit buttons in form using jquery such as "Save" and "Save & Mail". When i click "Save" button then Save process only need to go. If Click "Save & Mail" then records need to be saved and mail will trigger to admin. What i need is i want to differenciate these button in ajaxsubmit i mean i need to get these button values in ajax submit page (i want to get the button value either "save" or "Save & Mail" that which button clicked")...
- My Code is:
- <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
- <script src="js/jquery.js" type="text/javascript"></script>
<link rel="stylesheet" href="resources/css/validationEngine.jquery.css" type="text/css" />
<link rel="stylesheet" href="resources/css/template.css" type="text/css" />
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#formID1").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "submit.php",
ajaxSubmitMessage: "User Updated.",
success : function() {
},
failure : function() {}
})
});
</script> </head><body>
- <form id="formID1" name="formID1" class="formular" method="post" action="" >
- <table width="100%" border="1" align="left" cellpadding="0" cellspacing="0" style="border:1px solid #000;">
- <tr style="background-color:#E0E0E0;line-height:200%;"> <td class="contact_cont"> <b>Name</b> </td><td class="contact_cont"><b><input type="text" name="name" id="name" value="<?php echo $name;?>" class="validate[required,custom[onlyLetter],length[0,100]] text-input1"></b></td> </tr>
- <input src="images/default/btn-mail.gif" id="mail_button" value="mail" type="image" name="submit">
- <input src="images/default/btn-save" id="mail_button" value="save" type="image" name="submit">
- </table></form></body></html>
MY Submit page
- $buttonname=$_POST["submit"];
I want to get the button value here which button i clicked "Save" or "Save & Mail"
How to i get this