[eluser]jprateragg[/eluser]
EDIT: Typo in the title. Should be "custom" instead of "customer". I get a license error whenever I try to edit it.
I'm in the process of porting an existing application to CI. I have several forms where I check the values of the form and then set an error message if required. This is from my old application:
Code:
if($member_value == 0 && $adjusted_value == 0)
$error[] = "You must enter at least one member or adjusted value.";
if(($asset_category_id == 4 || $asset_category_id == 15 || $asset_category_id == 16)
&& $description == "") $error[] = "You must enter a description.";
In this example, I don't think it's possible to do this using the standard validation rules. This is more of custom error checking of data entered in by the user. For example, $member_value and $adjusted_value aren't allowed to be zero. And if the $asset_category_id = 4, 15, 16, then the user must enter a $description. I've also set a custom error message in the $error array.
Is this kind of error checking possible? Thanks!