User data in form

daniele80 08 Apr, 2017
Hi,
i want insert a user data in form.

this work in cf5:

<?php
$user = \JFactory::getUser();
$form->data['user_id'] = $user->id;
?>

i want the same in cc5 edit form

i tryed this:

<label>Periodo autorizzato da:</label><input type="text" readonly="readonly" class="form-control" value="<?php echo $user; ?>" name="ModuloRichiestaFerie[nome_conc_isp]" /><br />

but result 0

all tryes don't work, have some idea?

Thanks
Max_admin 08 Apr, 2017
Hi Daniele,

In your code you have this:
<?php echo $user; ?>

But maybe you should use:
<?php echo $user->id; ?>


Also, its advised to use Connectivity v6 for any new projects as it has more features.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.