Hi all,
I lover to work with CF and was wondering if it's possible to add a field that automaticly generates an number depending on the number of times the form has been used. This fiels must be send by mail to the sender as well as the responder.
I hope someone can help.
Hans
Hi Hans,
Probably the easiest way to do this is to save the form results to a database table and use the record_id as your counter.
You'll need to switch the Autogeneratdd code to 'Before Emails' to make this work OK.
Bob
Bob,
Thansk for your suggestions. However, i'm not that familiar with databases. I hoped it was possible by adding a simple visible autogenerated number field to the form.
I need this because the submitter (who receives a copy of his/her submission) has to use this number as his/her reference number.
Greetings,
Hans
Hi Hans,
in your onSubmit before email use this code:
<?php
JRequest::setVar('autonum', $MyForm->tablerow["table_name"]->uid);//change table_name to your real table name
?>
in your email template use :
{autonum}
Cheers
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Hi,
I have try the code,but in email display {autonum}
the code doesn't work in CF v3 ?
Hi juna,
Yes this was CFv3 code but it's an old post. What do you need to do?
Bob
Thanks for your suggestion
I have a succes to save form data to database. and I has create 1 field dep_id in my table and this is Auto Increments.
I need dep_id send by email to subsciber
how I make it?
thanks
Hi juna,
ChronoForms saves the database record in the $form->data array so that you can recover the new id. Drag a Debugger action into the ON Submit event to see the data available.
Bob
Hi GreyHead,
how to Drag Debugger ?
is this some feature of CF?
or this is not work on CFv3 ?
thanks