and want to sent email without page refresh via ajax..
<script type="text/javascript">
$(document).ready(function () {
var options = {
beforeSubmit: validate,
success: showResponse
};
$('#form').ajaxForm(options);
});
function showResponse(responseText, statusText, xhr, $form) {
$('#form').clearForm();
alert(statusText);
}
function validate(formData, jqForm, options) {
var usernameValue = $('input[name=LastName]').fieldValue();
var EmailValue = $('input[name=Email]').fieldValue();
var CompanyValue = $('input[name=Company]').fieldValue();
var DescriptionValue = $('textarea[name=Description]').fieldValue();
if (usernameValue[0]=="" || EmailValue[0]=="" || CompanyValue[0]=="" || DescriptionValue[0]=="") {
alert("Please enter values");
return false;
}
// alert(EmailValue[0]);
}
</script>
Email is being sent successfully, but issue is that SUCCESS method is not been called for FORM submit..
can someone tell me what could be the issue.