Formularios HTML DOM submit () método
Definición y Uso
método de envío () se utiliza para enviar el formulario (haga clic en el botón Enviar).
gramática
formObject.submit()
Soporte para el navegador
Todos los principales navegadores soportan enviar () método
Ejemplos
Ejemplos
Crear un formulario botón de envío:
<html>
<head>
<script>
function formSubmit()
{
document.getElementById("frm1").submit();
}
</script>
</head>
<body>
<form id="frm1" action="form_action.html">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="button" onclick="formSubmit()" value="Submit form">
</form>
</body>
</html>
<head>
<script>
function formSubmit()
{
document.getElementById("frm1").submit();
}
</script>
</head>
<body>
<form id="frm1" action="form_action.html">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="button" onclick="formSubmit()" value="Submit form">
</form>
</body>
</html>
Trate »
objeto de formulario