简体   繁体   中英

HTML5 - append a form

I want to a generate a form in JavaScript and append the form, but it does not work:

js fiddle

JS

var formData = new FormData();
formData.append("part_num", "123ABC"); 
formData.append("part_price", 7.95);
formData.append("part_image", somefile)

document.getElementById("form").append(formaData);

It looks like you are misusing the FormData object.

See how to use it here .

It is used to send data to the server, not to build forms on the client.

See how you should do it this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM