Hello
I am using latest version of AppGini 5.80
I am trying the code below to hide/show field base on condition
when I enter this code, it is not work
$j(function(){
$j('#selectionner-container').on('change', function(){
if($j('#selectionner').val() == 'GESTION DU PERSONNEL'){
$j('#periode').parents('.form-group').hide();
}else{
$j('#periode').parents('.form-group').show();
};
});
});
but when I enter like this, it is work. It seems the first condition is not working. Any idea please.
$j(function(){
$j('#selectionner-container').on('change', function(){
if($j('#selectionner').val() == 'GESTION DU PERSONNEL'){
$j('#periode').parents('.form-group').hide();
}else{
$j('#periode').parents('.form-group').hide();
};
});
});
even if I enter the code like this, it hide the field
$j(function(){
$j('#selectionner-container').on('change', function(){
if($j('#selectionner').val() == 'GESTION DU PERSONNEL'){
$j('#periode').parents('.form-group').show();
}else{
$j('#periode').parents('.form-group').hide();
};
});
});
Thank you
Hide/Show fields base on condition
Re: Hide/Show fields base on condition
Hi,
please check the value of
$j('#selectionner').val()
As this is a lookup, it will not contain the actual value, but the key to the lookup-table.
please check the value of
$j('#selectionner').val()
As this is a lookup, it will not contain the actual value, but the key to the lookup-table.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Hide/Show fields base on condition
Thank you
Re: Hide/Show fields base on condition
Hello
now it is working for me, but after I save, the field is displayed
my code
$j('#type_client').on('change', function(){
if($j('#type_client').val() == "PROFESSIONNEL"){
$j('#raison_sociale').parents('.form-group').show();
$j('#raison_sociale').focus().select();
}else{
$j('#raison_sociale').parents('.form-group').hide();
}
})
if it is a new record, it is working well, but after the record is saved, the hided field displayed again.
now it is working for me, but after I save, the field is displayed
my code
$j('#type_client').on('change', function(){
if($j('#type_client').val() == "PROFESSIONNEL"){
$j('#raison_sociale').parents('.form-group').show();
$j('#raison_sociale').focus().select();
}else{
$j('#raison_sociale').parents('.form-group').hide();
}
})
if it is a new record, it is working well, but after the record is saved, the hided field displayed again.