• 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: How to forbid a character in a text input field

How to forbid a character in a text input field 12 years 3 weeks ago #17184

I have code in the $_POST section that would be disrupted if a user input a pipe (|) character. There are also issues with code injection hacks that use the PHP/JAVA, and others, control characters. So I am now using this method below to protect ALL my text input fields on All my forms.

I solved it with validating the input in Validations/ "Validation Rule" -->Alphanumeric<-- and adding exceptions of all the "safe" special characters --> ~ ! @ # $ % ^ & * ( ) _ ` - = + ? : ' " , . <-- specifically in the "Validation Extra" field.

I left out the { } ; | < > / \ that I understand are used to inject malicious code into input boxes as attack/hacks. This works great for me so far!

In the General tab "Description" I informed:
"Text to be displayed. <br>
(It is OK to use the characters:<br> ~ ! @ # $ % ^ & * ( ) _ ` - = + ? : ' " , . "

In the "Validation Message" I informed the user:
"Sorry, Some character in the input is invalid.
It is OK to use: ~ ! @ # $ % ^ & * ( ) _ ` - = + ? : ' " , .
But we can't allow: { } ; | < > / \ and others. If you need some other special character added, please submit a ticket."

Thought I would share. Love input on any characters I should NOT have allowed for these same reasons...
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!