Accessing FormData Values

First thing I don’t think it’s possible to build a FormData object from a form as you’ve specified, and to get values from the form use the method described in the accepted answer — this is more of an addendum!

It looks like you can get some data out of a FormData object:

var formData = new FormData();
formData.append("email", "test1@test.com");
formData.append("email", "test2@test.com");
formData.get("email");

this will only return the first item for that key, in this case it will return ‘test1@test.com’, to get all the email addresses use the below code

formData.getAll("email")

Please see also: MDN article on formdata get method.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)