I have the following field:
<div class="line">
<label class="control-label">Tipo</label>
<select class="input-xxlarge idTipo" name="idTipo" id="idTipo" onChange="getParametro()" style="width: 715px !important;">
<option value="">Selecione o Tipo</option>
<option value="819">Faltas</option>
<option value="60">Atrasos</option>
<option value="69">Saída Antecipada</option>
</select>
</div>
<div class="line">
<label class="control-label">Data Solicitado</label>
<input id="dp1" class="input-small" style="width: 135px" name="data" type="date" required="required">
<label class="control-label">Data Cadastro</label>
<input id="dp1" class="input-small" style="width: 135px" name="data" type="date" required="required">
<label class="control-label" style="width: 58px !important">Horários</label>
<input id="dp1" class="input-small" name="hora_inicio" type="time" disabled>
<input id="dp1" class="input-small" name="hora_final" type="time" disabled>
</div>
I would like that when I select the idType, and if it is idType = 60, then enable the time fields we have below ... How to do this in Jquery?
This jQuery does the search for the next field (which I did not put in the ai code), but we can integrate that jQuery to enable the time.
function getParametro() {
var id = $('#idTipo').val();
$(".idParametro").append('<option value="0">Carregando...</option>');
$.post("<? echo base_url(''); ?>faltas/ajax/parametro/" + id,
{idParametro:jQuery(id).val()},
function(valor){
$(".idParametro").html(valor);
}
);
}