Hi,
in a form, available only for registered users, so that the user data are already known, I want to to show the respective fields already filled with user-id and user-email - but still writable.
So, I used in "Setup" section a custom code:
$user =& JFactory::getUser();
if ( $user->id > 0 ) {
$form->data['user_name'] = $user->name;
$form->data['user_email'] = $user->email;
}
In the "Designer" section I tried to make these data visible by "Edit element settings" -> tab "General" - > field "Field value".
But no manner of writing the variable makes the data visible when loading the form.
In this article I found a possible solution, but this seems to require a custom code field in the "Edit element settings":
http://www.chronoengine.com/faqs/3119-how-can-i-ask-new-users-for-information-and-not-ask-logged-in-users
Where should I put that html code, if this would be the only solution?
But I think there must be some easier and more elgant way to prefill those two fields?!
Regards,
Herbert
in a form, available only for registered users, so that the user data are already known, I want to to show the respective fields already filled with user-id and user-email - but still writable.
So, I used in "Setup" section a custom code:
$user =& JFactory::getUser();
if ( $user->id > 0 ) {
$form->data['user_name'] = $user->name;
$form->data['user_email'] = $user->email;
}
In the "Designer" section I tried to make these data visible by "Edit element settings" -> tab "General" - > field "Field value".
But no manner of writing the variable makes the data visible when loading the form.
In this article I found a possible solution, but this seems to require a custom code field in the "Edit element settings":
http://www.chronoengine.com/faqs/3119-how-can-i-ask-new-users-for-information-and-not-ask-logged-in-users
Where should I put that html code, if this would be the only solution?
But I think there must be some easier and more elgant way to prefill those two fields?!
Regards,
Herbert