• 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: Auto-generate a field

Auto-generate a field 9 years 8 months ago #32084

  • loneildo
  • loneildo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
Hello,

I would know how auto-generate a field?

When one will be enter to form, the field will generate a mix of numbers of letters as username.

Same for password.
The administrator has disabled public write access.

Auto-generate a field 9 years 8 months ago #32091

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Can you please be more specific on what you are trying to do ? Note that for each field you can execute PHP code within the "Default Value" area, thus populating it with a custom value. More details on form configuration here:

https://www.rsjoomla.com/support/documentation/rsform-pro/form-fields/textbox.html
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Auto-generate a field 9 years 8 months ago #32092

  • loneildo
  • loneildo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
Hello, thanks for your answer.

I want that username is automatically generated.

Example : customer enter in the page, form load, and a generated username is written directly on the field.
The administrator has disabled public write access.

Auto-generate a field 9 years 8 months ago #32094

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Try something like this, placed within the Default Value area of the username textbox:
//<code>
	$length = 6;
    $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
    $characters = str_shuffle($characters);
    return substr($characters, 0, $length);
//</code>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: loneildo

Auto-generate a field 9 years 8 months ago #32096

  • loneildo
  • loneildo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
Work perfectly, thanks a lot.
The administrator has disabled public write access.

Auto-generate a field 9 years 1 month ago #34618

  • mijie323
  • mijie323's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi. Please help me.

I want username auto generated, just like above. But, I don't want the random character.

What I want is like this:

if the first user register, he got the user name 'AB 00001'..
and if the next user register, he got username 'AB 00002'..

code 'AB' is fixed, but the numbers will be changed by order.

it is possible to achieve this..??

Sorry for my bad english. Hope you understand what I mean.

Thank you...
Last Edit: 9 years 1 month ago by mijie323.
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!