Forums

Is This Possible With ChronoForms?!

ravi94 28 Aug, 2011
Hello all

Im new here and I hope i'm in the right place! I have a bit of a difficult task which requires a web form that is only accessible when a user in a particular group is logged in (I think I know how to do that).

What I need the form to do is to record the username (and maybe email) of the logged-in user within a field of the form. Whether it is visible or not to the user. It has to be visible to the admins who use the data once the form is submitted. I believe I need to use the "custom element" but I do not know what code to use.

Just to clarify, I only want the username as the main thing and maybe the email.

Would somebody be able to guide me as to how I can achieve this. Bearing in mind I am only 16 and very new to Joomla, I haven't a clue what to do. I can make the form with no issue, just this issue of the username logging.

[b]My Version of Chronoforms is: 4.0 RC1.9[/b]
GreyHead 29 Aug, 2011
Hi Ravi94,

If you create a database table with ChronoForms then the Current User ID will automatically be saved into one of the columns. You can always use this to get the corresponding User name and email.

To get User info into an email add this code in a Custom Code action before the Email action
<?php
$user =& JFactory::getUser();
$form->data['user_username'] = $user->username;
$form->data['user_email'] = $user->email;
?>
Then you can use {user_username} and {user_email} in the Email template.

Bob
ravi94 29 Aug, 2011
Hi Bob

Thankyou for your reply, I appreciate it!

So what I need is possible then, that's good. just two questions:

When you say create a database table I assume that I will need to use/configure ChronoConnectivity? I haven't even looked at that yet, I managed to install it along with ChronoForms yesterday. I still don't even know how to use Joomla yet!

So I will use the custom element module and put the code above into there? And also what is the email template?

Okay I think I need to have a proper look at ChronoForms... Sorry about my lack of knowledge😉
GreyHead 30 Aug, 2011
Hi ravi94,

There is a Create Table icon in ChronoForms - you don't need ChronoConnectivity (that is for dsiplaying lists of records in Joomla! 1.5).

The Email Template is the tab on the Email Configuration where you enter the text/HTML you want to have in the email body.

Bob
ravi94 30 Aug, 2011
Yeah I figured that last night! Ive set up my form but its still having some issues.

I can't seem to get the ReCaptcha to work, on the form frontend it actually shows some code instead "{chronocaptcha_img}"

I think I might be missing a component... can someone run through the process of setting up ReCaptcha (I have my API public/private keys)
GreyHead 30 Aug, 2011
Hi ravi94,

In the Preview pane drag in a Custom Element and put {ReCaptcha} in the code box (I think that's the correct capitalisation). Remove the Captcha element if you have one.

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