CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • General Discussion (please no support requests here!) (Moderator: Michał Mach) »
  • How to have a specific validation on a field (form)?
Pages: [1]

Author Topic: How to have a specific validation on a field (form)?  (Read 274 times)

rich999999

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
How to have a specific validation on a field (form)?
April 30, 2016, 07:17:42 am
Hi,

I start with civicrm on wordpress.
Does-it possible to have a specific field's validation in form?

I would like verify a key for "legal indentity" in "organisation".

Thank you.

The verification's script is:

//Fonction verif
function isLuhnNum($num)
{
   //longueur de la chaine $num
   $length = strlen($num);
   
   //resultat de l'addition de tous les chiffres
   $tot = 0;
   for($i=$length-1;$i>=0;$i--)
   {
      $digit = substr($num, $i, 1);
      
      if ((($length - $i) % 2) == 0)
      {
         $digit = $digit*2;
         if ($digit>9)
         {
            $digit = $digit-9;
         }
      }
      $tot += $digit;
   }
   
   return (($tot % 10) == 0);
}

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • General Discussion (please no support requests here!) (Moderator: Michał Mach) »
  • How to have a specific validation on a field (form)?

This forum was archived on 2017-11-26.