Mandatory field
Posted: 2022-09-14 16:22
Is there an easy way to make a field mandatory except for the Admin
A place where AppGini users can exchange ideas and help each other.
https://forums.appgini.com:443/phpbb/
https://forums.appgini.com:443/phpbb/viewtopic.php?f=7&t=4894
$data
in _before hook on serverside (PHP) for example by replacing NULL by empty string.Code: Select all
<script>
const Group = '<?=getLoggedGroupID()?>';
</script>
Code: Select all
$j(function(){
$j('#update, #insert').click(function(){
//Group is defined in headers-extras.php as a const
var ChangeG = $j('#Field1').val();
if(ChangeG == '' && Group !== '2')
{
return show_error('ChangeGrouping', '<strong>Important: The Change Grouping must be entered</strong>');
}
});
})