• 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: Custom Validation Code

Custom Validation Code 10 years 1 month ago #30676

  • junior10
  • junior10's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
I'm trying to set a validation rule for one of my fields. I want this field to validate a column in my database. If the numbers they input are in that column then the user can proceed, If the numbers don't match then an an error comes up until they provide the right numbers. Does anyone know the RSForms codes so I can do that?
The administrator has disabled public write access.

Custom Validation Code 10 years 1 month ago #30691

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
RSForm!Pro allows the creation of custom validation rules. The following article explains how this can be done:

www.rsjoomla.com/support/documentation/v...alidation-rules.html

You can also add a script in Components >> RSForm!Pro >> Manage Forms >> edit your form >> Properties >> PHP Scripts >> Script called on form process that will perform this validation. You can refer to the following article for more information on this:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html

In the "Script called on form process" area you will find a script that uses the $invalid array in order to invalidate a field, you can use this array in your custom script to reach your goal.
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.

Custom Validation Code 10 years 1 month ago #30732

  • junior10
  • junior10's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Wonder if you can help me with this code. This is what I'm using in RSForms

}

public static function IBO Validation($value, $extra = null, $data = null) {
// The following makes sure the submitted value is "test"
if ($value == '123456789') {
// Return true if the validation passed.
return true;
} else {
// Return false if the validation didn't pass.
return false;
}

My problem is I don't want to set the $value to something specific and static. I want it to check the database #__comprofiler to see if a registered number is in the cb_registrationid column.

Can anyone help me?
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!