• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Confirmation or ID number

Confirmation or ID number 14 years 10 months ago #7608

Complete newbie so this may be a silly question.

I'm looking at creating a new online entry form for an events company and have been using Breezing forms until now... Is there a way that i can give and show a generated confirmation or ID number once submitted onscreen and also via email and have it saved in the submission database?
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7609

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

After the form has been submitted there will be a "Thank You" message on the screen that can be setup with any detail about the submitter with the help of placeholders.
Also you have 2 types of emails that you can send and customize, with the help of placeholders, Admin emails and User emails.
As for the ID Number you can use a Ticket number or a Hidden Field where you can write a custom PHP script where you can generate a random number from any interval you want.

For example you can write this in the Default Value field:
//<code>
$var=rand(10,100);
return var;
//</code>

The script above return a random number between 10 and 100.

Regards!
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7637

Thanks for that.

But what if i dont want a random number. Can i set the code to a preset alphanumeric and after each entry has been submitted then it increases the numeric figure.

eg.... 2010NATS-001.... 2010NATS-002.... 2010NATS-003 and so on.
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7656

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can try something like this:
//<code>
$var=rand(10,100);
return "2010NATS-".$var;
//</code>

Regards!
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7670

But wont that code still give it a random number after the 2010NATS-
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7680

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can add the following code in the Default Value of a Hidden Field (named for example "index" ):
//<code>
return "2010NATS-".str_pad(intval(@mysql_result(mysql_query("SELECT COUNT(`SubmissionId`) cnt FROM ".$RSadapter->tbl_rsform_submissions." WHERE FormId=1"),0)),3,"0",STR_PAD_LEFT);
//</code>

To display the result you can edit the "Thank you message" and add the following:

You are submitter number: {index:value}

Regards!
Last Edit: 14 years 10 months ago by bogdanc.
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7719

Cool thanks. Ill give this a try
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 10 months ago #7814

  • proexe
  • proexe's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 34
Is there a way to get a full random alphanumeric code, and not one where you have to start off with the same code at the beginning for the letter part of it?
The administrator has disabled public write access.

Re:Confirmation or ID number 14 years 7 months ago #8455

Hi again,

I have this working on my site but was wondering one more thing. Because this is being used on an online entry i currently have 3 forms that control different entry forms in little ways but the script is working fine where it is adding the database number to the submission, BUT if i create another group of entry forms (FormId=4 or Formid=5) then the number wont start at 0 it will continue on, is there a away in the script that i can force the entry to reset or start at 0.
return "2010NATS-SHOW-".str_pad(intval(@mysql_result(mysql_query("SELECT COUNT(`SubmissionId`) cnt FROM ".$RSadapter->tbl_rsform_submissions." WHERE FormId=3"),0)),3,"0",STR_PAD_LEFT);
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!