Posted By

rickyslow on 03/20/12


Tagged

select multiple


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrockSamsom


validar limite de elementos seleccionados en select multiple


 / Published in: jQuery
 

validar limite de elementos seleccionados en select multiple

  1. $('#selectRoles').change(function(event) {
  2. if ($(this).val().length > 5) {
  3. alert("Solo puede seleccionar 5 roles a la vez");
  4. $(this).val(ultimo_valido);
  5. }else{
  6. ultimo_valido = $(this).val();
  7. }
  8. });

Report this snippet  

You need to login to post a comment.