Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- div class="col-sm-4"><label>Tipo de documento de identidad</label><select class="form-control input-sm" id="idTipoDocumento" name = "nTipoDocumento">
- <option value="ID">ID</option>
- <option value="CARNÉ DE RESIDENTE">Carné de Residente</option>
- <option value="PASAPORTE">Pasaporte</option>
- </select>
- </div>
- $('#idTipoDocumento').on('change', function () {
- var documento = $(this).val();
- if(documento=="ID")
- {
- $('#idDocumento').attr("pattern", '[0-9]{8}-[0-9]{1}');
- $('#idDocumento').attr("placeholder", "FORMATO DUI ########-#");
- }
- $('#idTipoDocumento').on('change', function () {
- var documento = $(this).val();
- if(documento=="DUI")
- {
- $('#idDocumento').attr("pattern", '[0-9]{8}-[0-9]{1}');
- $('#idDocumento').attr("placeholder", "FORMATO DUI ########-#");
- }
- if(documento=="CARNET DE RESIDENTE")
- {
- $('#idDocumento').removeAttr("pattern");
- $('#idDocumento').attr("placeholder", "");
- }
- if(documento=="PASAPORTE")
- {
- $('#idDocumento').removeAttr("pattern");
- $('#idDocumento').attr("placeholder", "");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement