Analysis
(1)
First function looks like a replacement for
TABLENAME_dv($selectedID, $memberInfo, &$html, &$args)
-function in
hooks/TABLENAME.php
.
if (!) there was a
<div class="form-group">...</div>
, having a certain
id='NOM_ELEVE'
in a standard Detail View, this code would add a grey top border and top-margin.
But standard AppGini generated form-groups do not have any
id
attribute, as far as I know. So, this code will do just nothing unless you managed to add an
id="NOM_ELEVE"
-attribute to a detail view form-group.
(2)
Second function looks like it's meant to be a form validation function for form data.
But in standard AppGini, this will never get executed, unless you call it by yourself and evaluate
$args
by yourself.
---
Honestly speaking, those two functions look like AI-generated code fragments, missing knowledge about AppGini generated PHP and Javascript code. Sorry, if I'm wrong. I don't want to blame the author.
---
Possible solutions
You could tell us what you want and we can give you working code, for example:
(1) Add Border and margin to a form-group*
* Replace TABLENAME and COLUMNNAME accordingly
Code: Select all
// file: hooks/TABLENAME-dv.php
jQuery('.form-group.TABLENAME-COLUMNNAME').addClass("border-top");
Code: Select all
<!-- file: hooks/header-extras.php -->
<style>
.border-top {
border-top: 1px solid #ccc;
margin-top: 10px;
}
</style>
(2) Form Validation
Make use of
TABLENAME_before_insert()
-function and
TABLENAME_before_update()
-function in
hooks/TABLENAME.php
.
---
Please don't get me wrong, I really don't want to blame anyone. For me, those code fragments look like they are pointing you into a wrong direction and would bring more effort than needed. AppGini already brings validation features when using the
_before_
hooks.