Mandatory field
Re: Mandatory field
NOT NULL flag is defined on database level, not on UI level/code level.
Short answer: not possible unless you override validation on client side (javascript) AND modify
Short answer: not possible unless you override validation on client side (javascript) AND modify
$data
in _before hook on serverside (PHP) for example by replacing NULL by empty string.Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Mandatory field
thanks Jsetzer, you gave me an idea. I removed the not null from the DB & Appgini.
I then added a const to the /hooks/header-extras.php as wasn't sure how else to get the group ID in the dv file (not perfect but think it will work)
then I used the custom fault message in the /hooks/dv file
I have tested this a few times and seems to work ok. posting for anyone else looking for something similar.
I then added a const to the /hooks/header-extras.php as wasn't sure how else to get the group ID in the dv file (not perfect but think it will work)
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>');
}
});
})
AppGini 22.13