using appgini 5.72
created a magic table hook called dpt_ctasbly_req-tv.js
Inside have this function
Code: Select all
$j(function(){
$('#leave_panel_clinic').parents('.form-group').hide();
$j('#leave_application_type').on('change', function(){
if($j('#leave_application_type').val () == 'SL-SICK LEAVE'){
$j('#leave_panel_clinic').parents('.form-group').show();
}else{
$j('#leave_panel_clinic').parents('.form-group').hide();
$j('#leave_panel_clinic').focus().select();
}
})
})
Problem is when submit/update, the leave_panel_clinic will not show in detail. Suspected first line $('#leave_panel_clinic').parents('.form-group').hide(); cause the issue.
If remove $('#leave_panel_clinic').parents('.form-group').hide(); it will not hide on page load which is not what i want. This leave_panel_clinic field should be hidden until leave_application_type selected value is SL-SICK LEAVE then will show.
leave_application_type is dropdown value to select from.
leave_panel_clinic is dropdown value to select from.
I was wondering which part went wrong.
Help~
Thanks in advance.