evento onsubmit
Ejemplos
Ejecutado cuando el formulario se envía JavaScript:
<Form onsubmit = "myFunction ()">
Introducir nombre: <input type = "text">
<Input type = "submit">
</ Form>
Introducir nombre: <input type = "text">
<Input type = "submit">
</ Form>
Trate »
Definición y Uso y Uso
evento onsubmit activa cuando se envía el formulario.
Soporte para el navegador
evento | |||||
---|---|---|---|---|---|
onsubmit | sí | sí | sí | sí | sí |
gramática
En HTML:
<Elementoonsubmit = "myScript"> tratar
En JavaScript:
objeto .onsubmit = function () {myScript }; tratar
JavaScript, utilice el método addEventListener ():
objetar .addEventListener ( "enviar", myScript ); tratar
Nota: Internet Explorer 8 y versiones anteriores de IE no son compatibles con addEventListener () método.
Detalles técnicos
detalles técnicos
Ya sea para apoyar la burbuja: | sí |
---|---|
Puede ser cancelada: | no |
Tipo de evento: | evento |
etiquetas HTML compatibles: | <Form>, <keygen> |