HTML Form DOM soumettre () Méthode
Définition et utilisation
méthode submit () est utilisée pour soumettre le formulaire (cliquez sur le bouton Soumettre).
grammaire
formObject.submit()
support du navigateur
Tous les principaux navigateurs supportent submit () méthode
Exemples
Exemples
Créer un formulaire bouton de soumission:
<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>
Essayez »
Formulaire Object