Forums

from the text box to a dynamic dropdown

agostino87 10 Nov, 2016
Good morning, I have created three dynamic dropdown linked together (region, province, town). But I would like the first dropdown loads the user id already loaded into a text box with this code

<?php
$user = JFactory::getUser();
$form->data['codiceutente'] = $user->username;
?>


how can I do ? thank you
GreyHead 10 Nov, 2016
Hi agostino87,

You can add that in a Custom Code action before the HTML (Render form) action in the form ON Load event.

Bob
agostino87 10 Nov, 2016
I solved the problem by adding two fields to the table jos_user and then using the filters on them
GreyHead 10 Nov, 2016
Hi agostino87,

Good to hear you got it working - though altering the Joomla! tables is generally not recommended.

Bob
This topic is locked and no more replies can be posted.