Full username auto fill

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
mekin
Veteran Member
Posts: 40
Joined: 2019-04-22 17:09

Full username auto fill

Post by mekin » 2019-09-23 05:59

Hello, I searched the forum, but found 1 post about this topic a few years ago.

Is there a simple way to auto fill a field with the Full Username of a logged in user?

mekin
Veteran Member
Posts: 40
Joined: 2019-04-22 17:09

Re: Full username auto fill

Post by mekin » 2019-09-25 06:27

Ok, I got is so far, that if I put this "$data['naam'] =$memberInfo['custom'][0];" in a hooks\tablename.php under "function <tablename>_after_insert".
But I want that field to be read-only, so that is filled when a new record is added and cannot be changed, how can I do this?

mekin
Veteran Member
Posts: 40
Joined: 2019-04-22 17:09

Re: Full username auto fill

Post by mekin » 2019-09-25 07:15

Ok, I got it also read-only through hooks tablename-dv.js:

$j(function(){
if($j('#naam').val() == '') {
$j('#naam').prop('readonly', false);
}else{
$j('#naam').prop('readonly', true);
}
})

Post Reply