In this article we will describe how to ensure that the registry number is correct. For instance, if you enter a registration number, it must only allow a number which is on a predefined list. It will not allow a number which is not known. These codes will not be visible to the public.
In order to achieve this a new validation rule will have to be added to RSForm! Pro. Just edit the file /components/com_rsform/helpers/validation.php and add the new validation function here:
function registrationCode($param,$extra=null) { $validCodes = array('AAAA','BBBB','CCCC','DDDD'); $bul = true; foreach($validCodes as $validCode) if(strtolower($validCode) == strtolower($param)) { $bul = true; break; } else $bul = false; return $bul; }
Now a new validation rule will be selectable for your fields. You will just have to change the codes 'AAAA', 'BBBB', 'CCCC' and 'DDDD' with the ones of your choice.





