Quantcast
Channel: web – Imran Tariq's Blog
Viewing all articles
Browse latest Browse all 33

Dynamic HTML form creation and submit

$
0
0

Dynamic HTML form creation through JavaScript and submit

var form = document.createElement("form");
 form.setAttribute("method", "post");
 form.setAttribute("action", "/admin/delete.htm");
 var element1 = document.createElement('input');
 element1.value = idsList;
 element1.type = "hidden";
 element1.name = "idsList";
 form.appendChild(element1);
 document.body.appendChild(form);
 form.submit();

Share


Viewing all articles
Browse latest Browse all 33

Trending Articles