• 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: Need autoincrement hidden field

Need autoincrement hidden field 12 years 1 day ago #23055

  • jlg
  • jlg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
My client wants to hand out unique numbers for his registration form, but has specific requirements as to the format of the field, or I would go ahead and use the Support Ticket field that exists already.

Here's what he needs:

Name
Address, etc..

Hidden auto-increment field: IRR-aaa######
where IRR- does not change
aaa is a 3-letter increment beginning with AAA
###### is a 6-number increment

Is there some simple PHP code that I could attach to the field to make this work?

Toolie
The administrator has disabled public write access.

Need autoincrement hidden field 12 years 5 hours ago #23069

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

The "Support ticket" component only generates random sequences. As a simpler way you can try:

- adding 2 support ticket components. One will be "Alpha" configured with the length of 3, and the other one to "Numeric" with a length of 6.

- add a hidden field(with the default value 0) component which will contain the final sequence. A script within the "Scripts called on form process" can be used to combine both support tickets into your desired format, example:
if(empty($invalid))
$_POST['form']['hidden_field'] = "IRR-".$_POST['form']['supportTicket_alpha'].$_POST['form']['supportTicket_numeric'];

For the script above to work properly replace "supportTicket_alpha", "hidden_field" and "supportTicket_numeric" with your form components exact name. When the form submits the hidden field will have something like:

IRR-TFQ844589

More information on the PHP scripting areas within RSForm!Pro can be found here:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html
This is not official customer support. To receive your support, submit a support ticket here.
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!