We would like to know how to submit form in button action.
<!-- ww w .j av a 2s . c o m-->
<html>
<body>
<script language="JavaScript">
function submitForm(form){
document.form1.submit(form);
}
</script>
<form name= "form1" method="post" action="http://www.java2s.com">
This is a sample form
<br><br>
Name:<input type="text" size="40" name="name">
<br>
Age:<input type="text" size="3" name="age">
<br>
Phone Number:<input type="text" size="10" name="phone">
<br><br>
<input type= "button" value="Submit" onclick = submitForm(this.form)>
</form>
</body>
</html>
The code above is rendered as follows: