• 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: I need a function to check for min length and nume

I need a function to check for min length and nume 10 years 1 month ago #30911

B) Can someone help me add a validation to the validation.php file that checks for min length and numeric values? I have created

function minLength($param,$extra = null)
{
if(strlen($param) <= 6)
return false;

return true;
}
The administrator has disabled public write access.

I need a function to check for min length and nume 10 years 4 weeks ago #30918

  • bogdan.tataru
  • bogdan.tataru's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 174
  • Thank you received: 40
You can easily achieve this by adding a textbox field of type numeric to your form with a custom validation rule in the php scripts. So head to Components >> RSForm! Pro >> Manage Forms and select your form. Add a textbox field with the desired name and caption and in the Validations tab set Validation Rule to Numeric. Now for verifying the value length you need to add a custom PHP code in the "Script called on form process". In the Properties tab of your form search for "Script called on form process" and add the following PHP code:

if(strlen($_POST['form']['Custom'])<=6){
$invalid[] = RSFormProHelper::getComponentId('Custom');
}

Where 'Custom' is the name of the field you want to verify.
Notice that you don't need to include <?php ?> tags.
My help is not official customer support. To receive assistance, submit a ticket by clicking here
The administrator has disabled public write access.
The following user(s) said Thank You: uniqWeb
  • 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!