• 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: Validate a textbox

Validate a textbox 12 years 2 months ago #21912

  • greeps
  • greeps's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
I need to validate a textbox, the user can only enter a value between 1 and 9

Thank you
The administrator has disabled public write access.

Validate a textbox 12 years 2 months ago #21931

Hi Greeps:

Simply create a RegEx validation rule on the field's validation tab. Trying to pull RegEx code from the deep recesses of the mind, you might try ^\d{1}$ where "^" means "start looking at the begining of the user's answer", "/d" means a digit, "{1}" means "only 1 character" and "$" means "end of the user's answer."

I'm sure that someone with a better recollection of regular expressions could come up with a better answer than that. However, it should give you a start

CM
The administrator has disabled public write access.

Validate a textbox 12 years 2 months ago #21932

Check this out from the FAQ section in the documentation.
www.rsjoomla.com/support/documentation/v...n-does-not-work.html
It gives an example similar to Cymdeithas Madog's suggestion.

I've used this Regex sample and modified it to make a "human anti-spam" text box where the user has to read the question and enter a number that answers the question. It's slowed down the bad form submissions for me.

Good Luck,
K
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!