Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/02/2010, 10:04
ahome8990
 
Fecha de Ingreso: enero-2010
Mensajes: 39
Antigüedad: 14 años, 3 meses
Puntos: 0
Respuesta: Validaciones en javascript con validate.js

Encontré este script pero solo para los select, sin embargo no puedo hacer que funcione

Código Javascript:
Ver original
  1. jQuery.validator.addMethod(  
  2.    "selectNone",  
  3.    function(value, element) {  
  4.      if (element.value == "none")  
  5.      {  
  6.        return false;  
  7.      }  
  8.      else return true;  
  9.    },  
  10.    "Por favor seleccione una opcion."  
  11.  );  
  12.  
  13.  
  14. $(document).ready(function() {  
  15.    $("#form1").validate({  
  16.      rules: {  
  17.        opciones: {  
  18.          selectNone: true  
  19.        }  
  20.      },  
  21.    });  
  22. });

este es mi formulario

Código HTML:
Ver original
  1. <form id="form1" name="form1" method="post" action="mostrar.php">
  2.  <table width="200" height="30" border="0" cellpadding="0" cellspacing="0" align="right">
  3.     <tr>
  4.     <td ><select name="opciones" id="opciones" >
  5.     <option>Seleccione</option>
  6.     <option>opcion1</option>
  7.      <option>opcion2</option>
  8.     </select></td>
  9.     <tr>
  10.     <td ><input type="submit" name="mostrar" id="mostrar" value="Mostrar Seleccion" />
  11.     </td>
  12.      </tr>
  13. </form>

esta mal llamado o le falta algo?? o.o?