Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function limpiar() {
- 3 document.form.reset(); //limpiamos todo el formulario
- 4 document.form.nom.focus(); //el cursor se posiciona en el input nom
- 5 }
- 6
- 7 function validar() {
- 8 var form = document.form; // guardamos en la variable form document.form
- 9 if (form.nom.value==0) {
- 10 alert("Ingrese su Nombre");
- 11 form.nom.value=""; //Nos limpia el formulario nom
- 12 form.nom.focus(); //Posiciona el cursor en el formulario nombre
- 13 return false; //para que detenga el script
- 14 }
- 15
- 16 if (form.texto.value==0) {
- 17 alert("Inserte algun Texto");
- 18 form.texto.value=""; //limpiamos el textarea
- 19 form.texto.focus(); //posicionamos el cursor a texto
- 20 return false; // detenga el script
- 21 }
- 22 form.submit(); //Activamos el boton de escribir
- 23 }
- 24
- 25 //Funcion para crear el efecto en las filas de la tabla
- 26 function tr(id,color) {
- 27 document.getElementById(id).style.backgroundColor=color;
- 28 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement