Add More Submit Button

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

Demo :



Submit : 

Example :

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

Code :

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


<script type="text/javascript">
var submitCount = 0;
function addsubmit (parentEl)
{
  if (!parentEl)
  {
    return false;
  }
  parentEl = document.getElementById(parentEl);
  if (parentEl == null)
  {
    return false;
  }
  var newsubmit = document.createElement("input");
  newsubmit.type = "submit";
  newsubmit.id = "mysubmit"&++submitCount;
  newsubmit.name = "mysubmit";
  newsubmit.value = "Submit";
  newsubmit.className='submit_box';
  parentEl.appendChild(newsubmit);
  return false;
}
</script>
<fieldset id="somesubmits" class="submitset">
   <legend><input type="submit" value="Submit" ></legend>
</fieldset>
  <input type="button" value="Add More" onclick="return addsubmit('somesubmits');" >

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

Free Download Script:

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

Download




Content