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
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
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
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:
in your email template use :
{autonum}
Cheers
Max
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
Hi,
I have try the code,but in email display {autonum}
the code doesn't work in CF v3 ?
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
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
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
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
how to Drag Debugger ?
is this some feature of CF?
or this is not work on CFv3 ?
thanks
Hi Juna,
Sorry, I was confused, if you are using CFv3 then the code Max posted should work OK but you have to get the sequence correct. See this post for more info.
Bob
Sorry, I was confused, if you are using CFv3 then the code Max posted should work OK but you have to get the sequence correct. See this post for more info.
Bob
Hi GreyHead,
sory about make u confused.
I have try the code form the post
but I have output like this:
Fatal error: Class 'CFChronoForm' not found in /home/mask/public_html/components/com_chronocontact/chronocontact.php(600) : eval()'d code on line 2
Can u give me a code for CFv3 ?
thanks
sory about make u confused.
I have try the code form the post
<?php
$MyForm =& CFChronoForm::getInstance('FormIsiPulsa');
$autonum = $MyForm->tablerow['deposit']->dep_id;
echo $autonum;
?>
but I have output like this:
Fatal error: Class 'CFChronoForm' not found in /home/mask/public_html/components/com_chronocontact/chronocontact.php(600) : eval()'d code on line 2
Can u give me a code for CFv3 ?
thanks
This topic is locked and no more replies can be posted.