How Can I Go About Passing Data From A HTML Form To A JavaScript File That Handles AJAX Calls
How can I go about passing data from a HTML form to a JavaScript file that handles AJAX calls? submission_form.php 'icon',
Solution 1:
add a class or ID to the form tag.
echo elgg_view_form('submission_form', array('class' => 'elgg-form-submission_form'), array());
then in your JS file
$(".elgg-form-submission_form").submit(function( event ) {
$.post("service_comments/add_service_comment", $(this).serialize(), function(result) {
}
Post a Comment for "How Can I Go About Passing Data From A HTML Form To A JavaScript File That Handles AJAX Calls"