login chronoform

creositi 18 Sep, 2013
I created a registration form with chronoform, works perfectly, I connected to the database and saves the data safely. The registration form is quite comprehensive, including, for example, social security number, etc..
It does not quite understand how to create a simple login form. I just wish it came out a username and password by clicking one page summary of all the data entered. I'm three days I try guides and information but can not find anything, I tried and tried using DB RECORD LOADER but I'm probably wrong or skipping some steps ...
This is my main problem, while there are, however, I ask you another thing. Should I create another form, by including only the tax code will automatically populate some data like name surname etc, while others remain empty to fill out. It 'such a thing possible with chronoform?
I thank anyone help me!! THANK YOU THANK YOU THANK YOU
Ps ah Joomla version is 2.5 and 4 chronoform
I write from Italy so I apologize for how bad I write in English.
GreyHead 21 Sep, 2013
Hi creositi,

You can reload saved data from a database table using the DB Record Loader action. Assuming that you have added the User ID to the table you can use this to retrieve the matching record.

There's a FAQ about getting User Info which will show you how to get the User ID.

And Yes you can prepopulate a form with data from the table. If your inputs have the same name as the data you get from the table ChronoForms will handle that automatically.

Bob
creositi 24 Sep, 2013
THANK YOU SO MUCH!
I used DB Record Loader action. Now enter the address of the table and adding & token = username I leave the details of the user. But the thing I do not understand is this: the user fills in username and password (the default Joomla or even one created by me with chronoform) how do I connect the two?
I saw the FAQ but I can not use it. I need a step-by-step unfortunately.
GreyHead 24 Sep, 2013
Hi creositi,

The code you need is in the FAQ, please try that and post what you have used here if there are problems.

Bob
creositi 24 Sep, 2013
I for now I did this:
Creating user registration form :
Assigned various fields : user, password , name, date of birth , etc.
In events I've compiled as follows:
ON LOAD : show html
ON SUBMIT : Joomla User Registration ( OnFail -> Event Loop) / DB Save Enable - > Yes Table - > the database I created Model id chronoforms_data Save Under Model ID NO
This form works perfectly. You register and going in the database table you will see all the data of registered users .
The problem is the login.
I created a form as follows to display the data :
DB RECORD MULTI LOADER
Table (the table that I have created )
MODEL ID list
LOAD DATA YES
ENABLE DATA DISPLAYER NO
Display Fields
username:Username,Codicefiscale:Codice Fiscale,cognomeenome:Cognome e nome,datadinascita:Data di Nascita
Order Fields
username,Codicefiscale,cognome,nome,datadinascita

CUTOM CODE
<?php
// start ord
$img="";
if (Jrequest::getVar('direction','','get')=="") {
$ord="asc";
}
if (Jrequest::getVar('direction','','get')=="desc") {
$ord="asc";
$img="desc";
}
if (Jrequest::getVar('direction','','get')=="asc") {
$ord="desc";
$img="asc";
}
// end ord
?>
 
<table style="width: 100%" id="db_multi_record_loader">
<thead>
<tr>
<th style="width: 25%" class="col2 cell"><a class="order_link direction_asc"
 href="index.php?option=com_chronoforms&chronoform=Risultati&order=username&direction=<?php echo $ord; ?>
">Username <?php if (Jrequest::getVar('order','','get')=="username")
{echo "<img src=\"media/system/images/sort_".$img.".png\" alt=\"\"  />"; } ?></a></th>
<th style="width: 15%" class="col1 cell"><a class="order_link direction_asc"
 href="index.php?option=com_chronoforms&chronoform=Risultati&order=Codicefiscale&direction=<?php echo $ord; ?>"
>Codice fiscale <?php if (Jrequest::getVar('order','','get')=="Codicefiscale"){
echo "<img src=\"media/system/images/sort_".$img.".png\" alt=\"\"  />"; } ?></a></th>
<th style="width: 25%" class="col3 cell"><a class="order_link" 
href="index.php?option=com_chronoforms&chronoform=Risultati&order=cognomeenome&direction=<?php 
echo $ord; ?>">Cognome e nome 
<?php if (Jrequest::getVar('order','','get')=="cognomeenome"){
echo "<img src=\"media/system/images/sort_".$img.".png\" alt=\"\"  />"; } ?></a></th>
<th style="width: 25%" class="col3 cell"><a class="order_link" 
href="index.php?option=com_chronoforms&chronoform=Risultati&order=datadinascita&direction=<?php 
echo $ord; ?>">Data di Nascita 
<?php if (Jrequest::getVar('order','','get')=="datadinascita"){
echo "<img src=\"media/system/images/sort_".$img.".png\" alt=\"\"  />"; } ?></a></th>
</tr>
</thead>
 
<?php
$bb=$form->data['elenco'];
foreach ($bb as $a) {
echo "<tr><td>".$a['username']."</td><td><a class=\"order_link\" 
href=\"index.php?option=com_chronoforms&chronoform=Risultati2&rec=".$a['Codicefiscale']."\">".$a['Codicefiscale']."</a>
</td><td>".$a['cognomeenome']."</td><td>".$a['datadinascita']."</td></tr>";
}
?>
</table>
<p></p>

I copied this form and I did:
DB FIELD Username
Table (the table that I have created)
REQUEST PARAM token
Model ID elenco
The rest is all the same

Now typing http://www.sito.com/index.php?option=com_chronoforms&chronoform=Risultati-Copy&token = (username)
out the details of the user.
The problem is how do I make sure that the login joomla, the user entering your username and password to be redirected to this page?
creositi 24 Sep, 2013
Among other things, if I follow the information in the FAQ where I have to enter the data?
On load or on submit? How to connect to the login?
GreyHead 24 Sep, 2013
Hi creositi,

If it is a Joomla! Login form then I think that there is a setting for 'Redirect after login'; if it is a ChronoForm than you can use a ReDirect User action in the form On Submit event to redirect the user.

Bob
GreyHead 04 Oct, 2013
Hi creositi,

I'm sorry, I think that the question is getting lost in translation.

If you redirect from the Joomla! Login Form to a ChronoForm then you can get the User ID and username from the Joomla! User object.
<?php
$user =& JFactory::getUser();
$form->data['user_id'] = $user->id;
?>
and then use user_id in the DB Record Loader.

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