Add More Hidden Button

In the Add More Hidden Button script is use to create one or more a hidden button dynamically through DOM.

Demo :



Hidden : 

Example :

You click a Add More Button and see more hidden button at broswer.

Code :

Following code is Add More Hidden Button Script code if you need to copy and use to your web site.


<script type="text/javascript">
var hiddenCount = 0;
function addhidden (parentEl)
{
  if (!parentEl)
  {
    return false;
  }
  parentEl = document.getElementById(parentEl);
  if (parentEl == null)
  {
    return false;
  }
  var newhidden = document.createElement("input");
  newhidden.type = "hidden";
  newhidden.id = "myhidden"&++hiddenCount;
  newhidden.name = "myhidden";
  newhidden.value = "hidden";
  newhidden.className='hidden_box';
  parentEl.appendChild(newhidden);
  return false;
}
</script>
<fieldset id="somehiddens" class="hiddenset">
   <legend><input type="hidden" value="hidden" ></legend>
</fieldset>
  <input type="button" value="Add More" onclick="return addhidden('somehiddens');" >

In the above addhidden() function is use to create one or more a hidden button.That functions have one arguments that is parentEl.document.createElement("input") is generate a input hidden button and hiddenCount variable is use to create to child hidden box id.appendChild() function is use to replace dom object into original hidden button.

Free Download Script:

If you need to Add More Hidden Button Script click and download from following zip file.

Download




Content