Hi,
Let`s assume that I have this sample form with 3 fields :
-------
Name
-------
Phone
-------
Job
-------
Now I need additional hidden field to assign one generated random and unique code like [ABCDEFG123456] or any other code to above form and mail this unique code to user that submits data and webmaster.
Could you please guide me how can I do it?
Could I generate data and send it via FormBuilder?
Re: Could I generate data and send it via FormBuilder?
If I write a php random code as user defined code can I use it in Form Builder module and send it as type of submited data field?
Re: Could I generate data and send it via FormBuilder?
I created a User Defined Tag (let`s assume its name is "user_random_code") to generate random code :
Then in form I added one field (-Hidden Field) with name "user_code" and set {user_random_code} as its assigned value.
As I found we can`t use (-User Defined Tag Call) field because it doesn`t send any data to recipient emails and FormBrowser module.
Now I can generate ,send mail and store random strings as user code . Also use them as unique ID for every single user that send this information to webmaster :
-------
Name
-------
Phone
-------
Job
-------
And now I`m in one complicated step!I need to have another form to get these values :
------------
User Code
------------
Request
------------
and when user submits above form then webmaster should receive these values :
------------
User Code
------------
Name
------------
phone
------------
Job
------------
Request
------------
How could I fetch other data with using (User Code) and send them to email address(es) or store them in database?
thanks in advance
Code: Select all
function genRandomString() {
$length = 10;
$characters = "0123456789abcdefghijklmnopqrstuvwxyz";
$string = '';
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters))];
}
return $string;
}
echo genRandomString();
As I found we can`t use (-User Defined Tag Call) field because it doesn`t send any data to recipient emails and FormBrowser module.
Now I can generate ,send mail and store random strings as user code . Also use them as unique ID for every single user that send this information to webmaster :
-------
Name
-------
Phone
-------
Job
-------
And now I`m in one complicated step!I need to have another form to get these values :
------------
User Code
------------
Request
------------
and when user submits above form then webmaster should receive these values :
------------
User Code
------------
Name
------------
phone
------------
Job
------------
Request
------------
How could I fetch other data with using (User Code) and send them to email address(es) or store them in database?
thanks in advance
Re: Could I generate data and send it via FormBuilder?
Formbuilder has a fieldtype "Unique Integer (Serial)". Aren't you able to use that?
Re: Could I generate data and send it via FormBuilder?
Yes, it can be used too.There is no difference but I prefer a random string with 10 characters length.Jos wrote:Formbuilder has a fieldtype "Unique Integer (Serial)". Aren't you able to use that?
But now there is another issue!!! I have user code or user ID in database, how can I fetch other data
related to user code and post them with other forms data to email addresses or database?
Re: How could I make a validator for my forms?
How could I make a validator for my forms?
I mean that I have a form that contains (user code) field:
------------
User Code
------------
If the entered code (user code) there is in database user can fill and send the form else he/she will receive an error message.
I hope somebody help me to code above sentence!
Thanks
I mean that I have a form that contains (user code) field:
------------
User Code
------------
If the entered code (user code) there is in database user can fill and send the form else he/she will receive an error message.
I hope somebody help me to code above sentence!

Thanks