Forums

questions about "submit article"

glens1234 17 Jan, 2012
Hi. I have just purchased a license for chronoforms and I am trying to implement an RSVP form on my site. I would like to submit the form data to an article. However, as opposed to creating a new article for each submission, i would like to append the data from each submission to the same article.

So...after one submission the article will display...
Some Name, [email]someone@someemail.com[/email], Yes

After two submissions the article will display...
Some Name, [email]someone@someemail.com[/email], Yes
Another Name, [email]someone@someemail.com[/email], Yes

Can this be done using chronoforms? Of course, it would be nice if i could format the output into a table or something but thats for another time.

You help would be greatly appreciated.

Thanks.
GreyHead 18 Jan, 2012
Hi glens1234,

You can do this but you'll need to hand code it. You'll need to reload the existing article, add the extra part to the fulltext and re-save it again.

Bob
glens1234 18 Jan, 2012
ok thanks for the reply. However, i have no idea how to do this. I have tried reading the "Saving to a database table using ’bind’, ‘store’ and ‘save’" PDF but it doesn't appear to correlate with the version Chronoforms that i am using.

I remember doing something similar the old version of chronoforms and i have no knowledge of PHP. As far as i remember there was a tab where you could view the PHP/SQL code generated by the form which i was able to edit. I cannot find the code on this version. I can see the custom code action but i dont know how to code PHP. Can you please point me in the right direction? Is there somewhere i can see the code generated by the form?

Thanks
glens1234 18 Jan, 2012
Im not sure if it helps at all but the table looks like this...

cf_id 1
cf_uid d56a8ed54ec1c8da362d2e73ea187cf3
cf_created 2012-01-17 21:03:46
cf_modified
cf_ipaddress 11.11.11.1
cf_user_id 0
name me
email [email]myemail@yahoo.co.uk[/email]
attending Yes
input_submit_7 Submit

thanks
GreyHead 18 Jan, 2012
Hi glens1234,

You can see the Form HTML on the form General tab; click the Form Name link in the Forms Manager to get to it.

You can't see the AutoGenerated code in the same way in this version of ChronoForms but the DB Save action will save the data once you have created the amended version.

Bob
glens1234 18 Jan, 2012
Ok. Well it was the auto-generated code which i was after as I have no idea how to program PHP. So theres no easy way to update an article? Is there not just a simple MSQL command which will append this data to a joomla article?

Thanks.
GreyHead 18 Jan, 2012
Hi glens1234,

Simple answer, No there isn't.

Bob
glens1234 18 Jan, 2012
ok. But there was on the previous version. I know because i remember doing something similar about 4 years ago. Thanks.
GreyHead 18 Jan, 2012
Hi glens1234,

Could be, but not that I recall. There is the ability to save the form to a new article; I expect that updating an exisitng article is possible but requires a bit of coding.

Bob
glens1234 18 Jan, 2012
I see. I guess theres no reason for it to actually write to the article. I just need to display the contents of a record and i thought that writing to an article would be easier.

For example, is it possible to simply have a button with custom code that does something like this....


<?php
$query = "SELECT * FROM jos_chronoforms_data_myform;
echo $query;
?>


or..even better, the data is displayed when the page loads as opposed to pushing a button.

As mentioned i dont know PHP so i dont know how i would go about doing this, but im sure it must be easy.

Thanks.
glens1234 18 Jan, 2012
hi. dont worry. Ive figure it out although im not sure if this was the best way to do it. On the customer code of the button i added...


<?php

$result = mysql_query("SELECT * FROM jos_chronoforms_data_RSVP") 
or die(mysql_error());  

while($row = mysql_fetch_array( $result )) {
	// Print out the contents of each row into a table
	echo $row['name'];
	echo $row['email'];
        echo $row['attending'];
echo "<br /><br />";
} 


?>

Thanks.



GreyHead 18 Jan, 2012
Hi glens1234,

ChronoForms v4 has both a DB Record Loader (for a single record) and a DB Multi Record Loader action that will do that for you.

Bob
glens1234 18 Jan, 2012
Thanks. I tried using the DB Record Loader but couldn't get it to display anything. Anyway, after some messing around it does what i need it to do now🙂
This topic is locked and no more replies can be posted.