Forums

Savable forms for members

steffee 05 May, 2010
My website is a membership based, self-help program with a major part made up of worksheets (forms). I want indivdual members to be able to save the information they input into the forms under their account so that when they login they can access the indivdual info they put into their worksheet forms. I do not need to have access to any of their information. It is for their use and reference only. I have already made all the forms and installed chronoconnectivity and I just need to know what to do to make them savable for the user.

Thanks,
Stephanie
GreyHead 05 May, 2010
Hi Stephanie,

The User ID is the key here. I'm not sure how you have your data stored but if it's all in one table with a column called cf_id containing the User ID (that's the column name that ChronoForms uses by default) then you could have a user see their data by putting this into the CC Where box
<?php
$user =& JFactory::getUser();
echo "WHERE `cf_id` = '$user->id' ";
?>

Bob
steffee 08 May, 2010
Thanks for that information, but it seems that I cannot get past the regular set up for the form. I put my HTML code in from dreamweaver and set up the table and connected it, but when I looked at that the page online it had the following error:

Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';'in /home/steffee/public_html/components/com_chronocontact/chronocontact.php(53) : eval()'d code on line 9

I don't really know if I am setting up the other components of the form correctly or what that error is referring to.

Thanks,
Stephanie
GreyHead 08 May, 2010
Hi Stephanie,

The error is reporting a problem that ChronoForms has found when reading the record it keeps of the database table structure from the database. Usually this is because either the table name, or one of the column names includes a space, dash, or some other special character.

Bob
steffee 09 May, 2010
Okay, I got that problem fixed. I set up the page and put in the code you gave me into Chronoconnectivity. Now when I go on the page and type info into the form boxes, hit submit (save)all the info on the page disappears except the main template. Not sure what I am doing wrong.

Thanks,
Stephanie
GreyHead 09 May, 2010
Hi Stephanie,

When you go into **which** page? I'm confused about which part of the process this is - can you post a link to the problem page?

Bob
steffee 09 May, 2010
Sorry about that. I posted a link to the page below. The form section is at the top of the page and the save (submit) button is at the bottom of the page. When I check the form buttons at the top and click the save button at the bottom all the text disappears.

http://awarenessdiet.com/awarenesstrainingworksheet

Thanks,
Stephanie
GreyHead 10 May, 2010
Hi Stephanie,

This looks like normal ChronoForms behaviour* . . . what do you want to happen?

Bob

* When you submit ChronoForms displays a 'Thank you' page from the HTML in either of the Form Code On Submit boxes. You presumably have these boxes empty so nothing displays.
steffee 10 May, 2010
I want the page to stay up with the information still in it. It would also be great if there could be a little message that indicates the infromation was saved.

As of right now the program is not saving the information either. When I sign in as a user, check off the boxes and save it (submit it), the information is not there when I go back and look at the same page.

Thanks,
Stephanie
GreyHead 11 May, 2010
Hi Stephanie,

You can put the page URL in the Form ReDirect URL and then it will re-load after submission.

You will need to add some PHP to the Form HTML (a) to show the message that you want and (b) to re-show the saved data.

Bob

PS This woudl be a good case for an Ajax form so that the data is saved without refreshing the page.
corgolio 16 May, 2010

<?php
$user =& JFactory::getUser();
echo "WHERE `cf_id` = '$user->id' ";
?>



shouldn't it be uid instead of cf_id:

<?php
$user =& JFactory::getUser();
echo "WHERE `uid` = '$user->id' ";
?>
GreyHead 16 May, 2010
Hi corgolio,

It should be whatever the name of the column in the database table is.

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

VPS & Email Hosting 20% discount
hostinger