Forums

Misc form for misc user

loadlucas 31 Aug, 2015
Hello,

Under ChronoForms, would it be possible to display a specific form to the group of user login?
example:
I create various user with names of different companies and passwords and depending on the company name encoded login, it accesses a specific form for his company (with for example with a multiple choice drop down employees who must complete the form).

Thank you for your opinions and answers,

Loadlucas
GreyHead 31 Aug, 2015
Hi loadlucas,

What I think that you need to do is to add a Custom Code action to the beginning of the On Load event and add code their to check the users group(s) and get their company. You can use that information to get e.g. the list of employees and add it to the $form->data array for use in the Dynamic Options settings for a drop down element in the Designer tab.

Bob
loadlucas 20 Sep, 2015
Hi,
Thank to all of you for answers ...
That help me a lot ...

<?php
$user =& JFactory::getUser();
$name = '';
$email = '';
$readonly = '';
if ( $user->id > 0 ) {
  $name = $user->name;
  $email = $user->email;
  $readonly = "readonly='readonly'";
}
?>
<div class="ccms_form_element cfdiv_text" id="name_container_div" style="">
  <label for="name">Name</label>
  <input id="name" maxlength="150" size="30" class="" 
    title="" value=" <?php echo $name; ?> /" name="name" 
    type="text" <?php echo $readonly; ?> />
  <div class="clear"></div>
  <div id="error-message-name"></div>
</div>
<div class="ccms_form_element cfdiv_text" id="email_container_div" style="">
  <label for="email">Email</label>
  <input id="email" maxlength="150" size="30" class="" 
    title="" value=" <?php echo $email; ?> /" name="email" 
    type="text" <?php echo $readonly; ?> />
  <div class="clear"></div>
  <div id="error-message-email"></div>
</div>

This can work fine ...
I will try the other way explaind by Greyhead later ...
Thank You very much

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