Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/06/2016, 14:03
Avatar de rodrypaladin
rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: HTML5 Formulario-"campo requerido" no funciona en IOS

Encontré est solución en JQuery, no la he probado pero supuestamente es para ello.

Código Javascript:
Ver original
  1. $('form').submit(function(){
  2.     var required = $('[required="true"]'); // change to [required] if not using true option as part of the attribute as it is not really needed.
  3.     var error = false;
  4.  
  5.     for(var i = 0; i <= (required.length - 1);i++)
  6.     {
  7.         if(required[i].value == '') // tests that each required value does not equal blank, you could put in more stringent checks here if you wish.
  8.         {
  9.             required[i].style.backgroundColor = 'rgb(255,155,155)';
  10.             error = true; // if any inputs fail validation then the error variable will be set to true;    
  11.         }
  12.     }
  13.  
  14.     if(error) // if error is true;
  15.     {
  16.         return false; // stop the form from being submitted.
  17.     }
  18. });
__________________
No te olvides de dar +1 a quien te echa un cable ;)