Hi lx,
Below is my code:
$requiredFields is the list of all the required fields on my form
Array
(
[0] => FirstName
[1] => Lastname
[2] => Email
[3] => Address
[4] => City
[5] => Country
[6] => S_Name
[7] => S_Address
[8] => S_City
[9] => S_Country
[10] => Pwd[_Pwd]
[11] => Pwd[_ConPwd]
[12] => CM_Name
[13] => CM_Address
[14] => CM_Telephone
[15] => CM_Email
[16] => CM_DOB
[17] => CM_Company
)
foreach($requiredFields as $requiredField){
$rule_Required[] = new NetefxValidatorRuleREQUIRED($requiredField, "Please enter your $requiredField", 'error');
}
$validator = new NetefxValidator($rule_Required);
$this->extend('updateValidator',$validator);
parent::__construct($controller, $name, $fields, $actions, $validator);
I am making these changes on OrderForm of the ecommerce module