Accessing form data in JS

Picture of Amitpal Singh
Amitpal Singh
July 11, 2023

Accessing form data in JS

var formData = new FormData(myForm);
for (var p of formData) {
    let name = p[0];
    let value = p[1];

    console.log(name, value)
}

Share this post:

How to Attribute?

Lorem ipsum is typically a corrupted version of De finibus bonorum et malorum, a 1st-century BC text by the Roman statesman and philosopher Cicero.
for Example: Website, Social Media, Blogs, ebooks , newsletter, etc.
Lorem ipsum is typically a corrupted version of De finibus bonorum et malorum, a 1st-century BC text by the Roman statesman and philosopher Cicero.
Copied!

Got a Question? Check out our FAQ Section.

Your action, our appreciation

It encourage us to give you more valuable content on website.