Hello!
There is a form in the form of a questionnaire. How to do so, to fill in the questionnaire could only registered user and each registered user can fill out the application only one time?
joomla1.5.26, Chronoforms_V4_RC3.5.1
There is a form in the form of a questionnaire. How to do so, to fill in the questionnaire could only registered user and each registered user can fill out the application only one time?
joomla1.5.26, Chronoforms_V4_RC3.5.1
Hi msweb,
You can use the Authenticator action to restrict the form to registered users.
Save the User ID with the form results in the database, the ChronoForms DB Save action will do this for you.
When the form loads check the saved records to see if the current User ID is already recorded. If it is then don't show the form.
Bob
You can use the Authenticator action to restrict the form to registered users.
Save the User ID with the form results in the database, the ChronoForms DB Save action will do this for you.
When the form loads check the saved records to see if the current User ID is already recorded. If it is then don't show the form.
Bob
Hi Hubneraf,
There are various ways to do it depending on what you want to happen. The simplest is to add a Custom Code action and add the code to it to query the database table and redirect the user with a message if a record is found.
Bob
There are various ways to do it depending on what you want to happen. The simplest is to add a Custom Code action and add the code to it to query the database table and redirect the user with a message if a record is found.
Bob
i undestand it
my problem is that i don't undestant how insert che custom code... and what sort of code i have to write
can you write an example please?π
thanks
my problem is that i don't undestant how insert che custom code... and what sort of code i have to write
can you write an example please?π
thanks
Hi hubernaf,
Do you have the form data saving to a Database table now? If not, please see this FAQ.
Bob
Do you have the form data saving to a Database table now? If not, please see this FAQ.
Bob
Hi hubernaf,
What have you tried so far?
What is the name of the database table and what column do you need to check?
Bob
What have you tried so far?
What is the name of the database table and what column do you need to check?
Bob
thanks bob
my db tagle is karmg_chronoforms_data_prova6 and i want to check for user id so, cf_user_id
thanks
my db tagle is karmg_chronoforms_data_prova6 and i want to check for user id so, cf_user_id
thanks
Hi hubneraf,
You can use an Event Switcher [GH] action and the code will be something like:
Bob
You can use an Event Switcher [GH] action and the code will be something like:
<?php
$user =& JFactory::getUser();
$db =& JFactory::getDBO();
$query = "
SELECT COUNT(*)
FROM `#__chronoforms_data_prova6`
WHERE `cf_user_id` = '{$user->id}' ;
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count >= 1 ) {
// the form has already been completed
return 'event_a';
}
?>
Bob
This topic is locked and no more replies can be posted.