jueves, 30 de mayo de 2019

radios final

radiobutton

<input type="radio" value="SI"
 name="tiempo_horario" 
<?php if($tiempo_horario == "SI" ){ echo "checked";}
 ?> ;" />





































-------------------------------------










<input type="radio" value="NO" 
name="tiempo_horario" 
<?php if($tiempo_horario == "NO" ){ echo "checked";}
?> ;" />

jueves, 23 de mayo de 2019

desactivacion de campos

COLOCAR EN LOS CHECKBOXES


onclick="deshabilitar('bloquear');"


onclick="deshabilitar('');"



COLOCAR EN OTRO SCRIPT AL FINAL


<script>

function deshabilitar(elemento){

   if(elemento == "bloquear"){
      document.getElementById('campo1').disabled=true;
      document.getElementById('campo2').disabled=true;
      document.getElementById('campo3').disabled=true;
}else{ document.getElementById('campo1').disabled=false;
      document.getElementById('campo2').disabled=false;
      document.getElementById('campo3').disabled=false;
} }

</script>




Validación de numero JQUERY

<script src="comun/datePickerJQuery/js/jquery-1.7.2.min.js">
</script>
<script>    $("#number").on({
        "focus": function(event) {
            $(event.target).select();        },        "keyup": function(event) {
            $(event.target).val(function(index, value) {
                return value.replace(/\D/g, "")
                    .replace(/([0-9])([0-9]{2})$/, '$1.$2')
                    .replace(/\B(?=(\d{3})+(?!\d)\.?)/g, ",");            });        }
    });</script>

validacion numeros




onkeypress="return validarNumeroDocencia(this);"




function validarNumeroDocencia(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
    return true;}

Validacion Checkboxes

var horario =  document.getElementsByClassName("hor");
        var arrayLength = horario.length;
        var contador = 0;

        for (var i = 0; i < arrayLength; i++) {
        if (horario[i].checked == true){
                    contador = contador +1;
             }
        }

        for (var i = 0; i < arrayLength; i++) {
            horario[i].addEventListener('change', function(){
                if (this.checked == true){
                    contador = contador +1;
                }
                if (contador > 2){
                    contador = 0;
                    pr_t_horario.checked = false;
                    pr_medio_t.checked = false;
pr_t_completo.checked = false;
                    alert("No se pueden seleccionar mas de 2 opciones");
                }
            })
        }





id="pr_t_completo" class="hor"