Bueno eso, quiero que al apretar el boton grabar por ejemplo, si un campo era obligatorio y está en blanco aparezca una alerta avisando del caso y detenga en submit. Algo asi como una función para controlar este suceso.
gracias a todos.
| ||||
Código HTML: <form name="tuform" method="post" onsubmit="return validar(this)"> <input type="text" value="" name="mytext"> </form> Código HTML: <script> function validar(f) { if (f.mytext.value == "") { alert("debes colocar algo antes de grabar.") f.mytext.focus(); return false } return true } </script>
__________________ Saruman One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them. |