Jump to content

creating a hidden field from within a javascript function


anu123

Recommended Posts

try this

 

var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "hiddenfield");
input.setAttribute("value", "somevalue");
document.getElementById("formid").appendChild(input);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.