Q . How to submit a html form with javascript?

Brad Johnson. asked, Nov 29 ' 2014

Recently I am using the below code but it is not working.

 

<form name="email_form" id="email_form" action="" method="post">

<input type="text" name="name" id="name" />
<input type="text" name="email" id="email" />

<input type="button" name="submit" onclick="submitForm()" value="Submit" /> 
</form>



<script>

function submitForm(){
    document.getElementById('email_form').submit();
}

</script>

 

  • JavaScript
  • html-form

0 Answers

Leave a Ansewer