• 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: Siret Verification Function

Siret Verification Function 13 years 1 month ago #13351

Hi,

The Siret verification function needed. I'm trying to add function to a Textbox component. I added current code:
function is_siret($siret)
	{
		if (strlen($siret) != 14) 
		return 1;
		if (!is_numeric($siret)) 
		return 2;
 
		for ($index = 0; $index < 14; $index ++)
		{
			$number = (int) $siret[$index];
			if (($index % 2) == 0) 
			{ 
			if (($number *= 2) > 9) $number -= 9; 
			}
			$sum += $number;
		}
 
		if (($sum % 10) != 0) 
		return 3; 
		else return 0;		
	}

in components/com_rsform/helpers/validation.php file as mentioned here

www.rsjoomla.com/customer-support/docume...alidation-rules.html

and assigned Validation Rule to a Textbox component as is_siret but it doesn't works.

Any suggestions what I'm doing wrong please.

Thanks
Last Edit: 13 years 1 month ago by eriksson88.
The administrator has disabled public write access.

Re:Siret Verification Function 13 years 1 month ago #13362

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

Please note that a validation rule can only return true or false
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.
  • 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!