• 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: Adding ExtraCustomValidation characters to a field

Adding ExtraCustomValidation characters to a field 13 years 2 weeks ago #13509

I'd like to add several characters as Extra or Custom Validation characters to a Name field.

Reading the file components/com_rsform/helpers/validation.php does not make te answer entirely clear to me.

Would this code validate a-z OR A-Z AND/OR - (hyphen) AND/OR an ' (apostrophe)?

function custom($param,$extra=null)
{
if(strpos($param,"\n") !== FALSE)
$param = str_replace(array("\r","\n"),'',$param);

for($i=0;$i<strlen($param);$i++)
if(strpos($extra,$param[$i]) === false && preg_match('#([^a-zA-Z-' ])#', $param[$i]))
return false;

return true;
}

Any Answers?

Peter
The administrator has disabled public write access.

Re:Adding ExtraCustomValidation characters to a field 12 years 9 months ago #14390

  • webcat-solutions
  • webcat-solutions's Avatar
  • OFFLINE
  • Junior Boarder
  • Dutch Joomla specialist
  • Posts: 29
  • Thank you received: 4
I know this post is quite old already, but wouldn't it be easier to just use 'Alpha' Validation on the Name field, and fill in the following in the field 'Extra validation': '-
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!