Hide DatePicker(fields) when check box not checked

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
richard
Posts: 10
Joined: 2023-03-22 13:08
Location: Oroville CA
Contact:

Hide DatePicker(fields) when check box not checked

Post by richard » 2023-03-22 15:08

Been trying to get a check box not checked to hide a date field (picker)
here is what I have tried with no joy.
I created Items-dv.js in my hooks folder and added this code:

/* hide Desposal Date when Desposed is not checked */
$j(function(){
$j('#Desposed').keyup(function(){

if($j('#Desposed').prop('checked')){
$j('#DesposalDate-mm').parents('.form-group').show();
}else{
$j('#DesposalDate-mm').parents('.form-group').hide();
}
});
});

$j('#Desposed').keyup();
Can anyone help me figure out what I did wrong ?

Post Reply