Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. div class="col-sm-4"><label>Tipo de documento de identidad</label><select class="form-control input-sm" id="idTipoDocumento" name = "nTipoDocumento">
  2. <option value="ID">ID</option>
  3. <option value="CARNÉ DE RESIDENTE">Carné de Residente</option>
  4. <option value="PASAPORTE">Pasaporte</option>
  5. </select>
  6. </div>
  7.  
  8. $('#idTipoDocumento').on('change', function () {
  9. var documento = $(this).val();
  10. if(documento=="ID")
  11. {
  12. $('#idDocumento').attr("pattern", '[0-9]{8}-[0-9]{1}');
  13. $('#idDocumento').attr("placeholder", "FORMATO DUI ########-#");
  14. }
  15.  
  16. $('#idTipoDocumento').on('change', function () {
  17. var documento = $(this).val();
  18. if(documento=="DUI")
  19. {
  20. $('#idDocumento').attr("pattern", '[0-9]{8}-[0-9]{1}');
  21. $('#idDocumento').attr("placeholder", "FORMATO DUI ########-#");
  22. }
  23.  
  24. if(documento=="CARNET DE RESIDENTE")
  25. {
  26. $('#idDocumento').removeAttr("pattern");
  27. $('#idDocumento').attr("placeholder", "");
  28. }
  29.  
  30. if(documento=="PASAPORTE")
  31. {
  32. $('#idDocumento').removeAttr("pattern");
  33. $('#idDocumento').attr("placeholder", "");
  34. }
  35.  
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement