[php] hola
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- function valida_envia()
- {
- //valido el nombre
- if (document.fvalida.Nombre.value.length==0){
- alert("Tiene que escribir su nombre")
- document.fvalida.nombre.focus()
- return 0;
- }
- if (document.fvalida.Apellidos.value.length==0){
- alert("Tiene que escribir sus apellidos")
- document.fvalida.apellidos.focus()
- return 0;
- }
- //valido la edad. tiene que ser entero mayor que 18
- edad = document.fvalida.edad.value
- //edad = validarEntero(edad)
- document.fvalida.edad.value=edad
- if (edad=="")
- {
- alert("Tiene que introducir un número entero en su edad.")
- document.fvalida.edad.focus()
- return 0;
- }
- else{
- if (edad<18)
- {
- alert("Debe ser mayor de 18 años.")
- document.fvalida.edad.focus()
- return 0;
- }
- }
- //valida Correo
- if (document.fvalida.correo.value==0){
- alert("Tiene que escribir su correo")
- document.fvalida.correo.focus()
- return 0;
- }
- //valida radiobutton
- if (document.fvalida.sexo.value==0)
- {
- alert("Tiene elegir su Sexo")
- document.fvalida.sexo.focus()
- return 0;
- }
- //valida Checkbox
- if (document.fvalida.opinion1.value==0)
- {
- alert("Tiene elegir una de las 3 opciones")
- document.fvalida.opinion1.focus()
- return 0;
- }
- //el formulario se envia
- alert("Muchas gracias por enviar el formulario");
- document.fvalida.submit();
- }
Editor
You can edit this paste and save as new:
File Description
- hola
- Paste Code
- 25 Sep-2021
- 1.78 Kb
You can Share it: