Answers for "call named function on form submit jquery"

3

when a form is subbmited jquery

$("#myform").submit(function(e) {
 })
Posted by: Guest on July-03-2020
0

ajax post form listener button

$("button").click(function(e) {
    e.preventDefault();
    $.ajax({
        type: "POST",
        url: "/pages/test/",
        data: { 
            id: $(this).val(), // < note use of 'this' here
            access_token: $("#access_token").val() 
        },
        success: function(result) {
            alert('ok');
        },
        error: function(result) {
            alert('error');
        }
    });
});
Posted by: Guest on July-21-2020

Code answers related to "call named function on form submit jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language