DEV Community

Cover image for Get form data and POST with JavaScript(jQuery)
Alim AJ
Alim AJ

Posted on

2 2

Get form data and POST with JavaScript(jQuery)

Intro

This article is a note of what I found and applied to fetch data on a form and send it in jquery with the POST method.

Try

get form data

var fd = new FormData(document.getElementById('filter-data'))
// if you want to add data use append
fd.append('limit',limit);
fd.append('start',start);
Enter fullscreen mode Exit fullscreen mode

POST data with jquery

$.ajax({
    url: "your_url",
    method: "POST",
    data: fd,
    cache: false,
    contentType: false,
    processData: false,
    success: function(data){
        // action success
    }
})
Enter fullscreen mode Exit fullscreen mode

like if you find this useful

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more