Forums

AutoFill

alex305v 25 Apr, 2015
I have been trying for a long time how to do Autofill for logged in members in forms. When I finally got it from another post, it worked but it wont save it, I cant see it on the emails or databases, and if I make the textbox required and disable the form says it's empty when its clearly not. This is the code I am currently using.

<?php
$user =& JFactory::getUser();
$form->data['id'] = $user->id;
$form->data['email'] = $user->email;
$form->data['name'] = $user->name;
$form->data['username'] = $user->username;
?>
GreyHead 25 Apr, 2015
Hi alex305v,

If you disable inputs then the data is not submitted - as you found. To show the data as 'read only' put readonly=readonly in the Extra params box of the input.

Bob

PS I suggest that you don't use your email as a username here as it is publicly visible and may be scraped and misused.
This topic is locked and no more replies can be posted.