Reputation: 429
I had written an old javascript file which includes some functions and I want to call some of them within JQuery, so how can I get the form object as in this code check_form(frmAddDominate,'<?php echo $_SESSION[sesLang]; ?>')
I put the form name "frmAddDominate" because I failed to get its name as variable, anybody have idea?
And here is the complete code:
<script>
$(document).ready(function() {
$("#dominateSubmitForm").click(function() {
if (check_form(frmAddDominate, '<?php echo $_SESSION[sesLang]; ?>')) {
var form = $(this).closest("form").attr('id');
var formURL = $('#' + form).attr("action");
var formData = $('#' + form).serialize();
$.ajax({
type: 'POST',
url: formURL,
data: formData,
success: function(response) {
//$('#' + form).find('.form_result').html(response);
$("#txtHint").html(response);
}
});
}
});
});
</script>
Upvotes: 0
Views: 94