Forums

Fast send of form for logged in users

Dementiev 04 Feb, 2015
Could you please help to realize a simplified filling of form for registered users, and a basic form for public?

I mean if user is logged in, he must fill only one field of the form (it is an "Event", and form is a request for entry to event), other fields will be filled automatically from login user info.
And also a public user must have an opportunity to fill form, but all fields.

I've tried to use "DB save" and "DB read" as described in you FAQ. It works good as a kind for logged in users, but for guests form display filled fields from previous guest user data. But it would be empty for public users.
In table the "user_id" for guests is set as 0, I think it is cause?

In general, tell me please the simplest way for filing form on the minimum data by registered users.

Thank you very much in advance!
Max_admin 04 Feb, 2015
Hi Dementiev,

How did you configure the "DB Read" ? please post the conditions code you have!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Dementiev 05 Feb, 2015
Hi, Max,

I did only as described in FAQ How to store and load user's data, this code:

<?php
$user = JFactory::getUser();
return array("user_id" => $user->get("id"));


And "DB Save" action created as usual, by standart CF5 functions (created table and connected to action by selecting in parameters).

I can make a screenshots and give link to form, if need.

And will study a way suggested by "calculus00" so far.

Thank you
Max_admin 05 Feb, 2015
1 Likes
Well, what do you want to happen when a guest opens the form ? if you want the data to be stored then just place your "DB Read" action inside an "Authenticator" action and configure the Auth action to allow only "Registered" users, this means that the data read will only happen to logged in users.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Dementiev 05 Feb, 2015
Thanks for answer, I will try. I think it enough for me to show the empty form for guests, and filled form with some fields for registered users.

But is there a way to edit fields which display as filled for registered users?
For instance, "name", "email" and "phone" - are filled permanently. And other fields must be empty..
Max_admin 05 Feb, 2015
You can do this by unsetting the data fields after the "db read", you can use a "custom code" action to do that!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Dementiev 05 Feb, 2015
Max, I tried an "Authenticator" action with DB Read for logged in users - it works, thank you!

But could you clarify please, how (where) can I remove some fields from html form for registered users?
E.g., members should not input "Captcha" and "agree with conditions", I want it do not show in form and not validate after Submit.
Max_admin 05 Feb, 2015
I think I misunderstood your question earlier then, you can not do this because the fields don't have permissions check, you can however control the actions.
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Dementiev 06 Feb, 2015
Ok, could you advice please any another way to fill a form for registered users with minimum required fields, without captcha?
And for guests - with captcha and other required fields. Possibly, it must be two different forms?
Does anyone tried this?

Thanks for help!
GreyHead 06 Feb, 2015
Hi Dementiev,

Two different forms may be simplest.

You can do it in one form by getting the User ID at the beginning of the On Load event and then loading the User info into the $form->data array (there's a FAQ on that).

Hiding the Captcha is also possible with a little PHP - basically use a container that only shows the content if the User iD is 0. After the form is submitted you'd also have to use an Event Switcher so that the Check Captcha action only runs for guest users.

Bob
Dementiev 09 Feb, 2015
Hi GreyHead,

Thanks for answer!

Could you explain how to use two forms depending on logged or guest user, please? I'm not very good in PHP.
What are the main steps?

And also, sorry for little offtopic quastion - in CF5 I can't find the "refresh" button for captcha, is it somewhere?

Thank you!
Max_admin 10 Feb, 2015
The refresh button is under the "load Captcha" settings!

You can control the form access using the "Authenticator" action!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Dementiev 13 Feb, 2015
Thank you Max and Bob for tips, I have achieved a result of fill a form for different groups of users.
I use "Authenticator" and "Load form" actions (for two different forms) - it is maybe the simplest way:



But this way apparently not working with CF plugin {/chronoforms} inside the component (I use in DPCalendar component), the form just reload on submit without any other actions. Well, I created a link at menu and use it - all OK.

Thank you very much for your work!
Max_admin 13 Feb, 2015
Well, you don't have any actions in the "on submit" event.

If the "DPCalendar" has caching then you may try to disable this.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.