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?
Full username auto fill
Re: Full username auto fill
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?
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?
Re: Full username auto fill
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);
}
})
$j(function(){
if($j('#naam').val() == '') {
$j('#naam').prop('readonly', false);
}else{
$j('#naam').prop('readonly', true);
}
})