Sending submissions with AJAX

Accepting file uploads with AJAX is not supported by some browsers like Internet Explorer, but you can still do it with Getform. Paste the following AJAX code before your body tag:

           var action = $(this).attr("action");
               type: "POST",
               url: action,
               crossDomain: true,
               data: new FormData(this),
               dataType: "json",
               contentType: 'multipart/form-data',
               processData: false,
               contentType: false,
               success: function(response){
                 if(response.status == "success"){
                   alert("We received your submission, thank you!");
                   alert("An error occured.");


Note: You should add enctype="multipart/formdata" as in the regular case.

After that you can add class="ajaxForm" to your HTML form to finish the setup like this:

<form class="ajaxForm" action="{your-endpoint}" method="POST" enctype="multipart/form-data">

    <input type="text" name="name" id=”name”>
    <input type="email" name="email" id=”email”>
    <input type="file" name="file">
    <button type="submit">Send</button>


That's it! You can also accept files for your form submissions using AJAX.