Set Validation Rules

It works the same as codeigniter's rules .
function example_set_rules() {
    $crud = new grocery_CRUD();
    $crud->set_rules('buyPrice','buy Price','numeric');
    $crud->set_rules('quantityInStock','Quantity In Stock','integer');
    $output = $crud->render();
Note: The below example is an iframe so it might appeared with a scroll bar. If you like you can view the example on a new tab

For more about the function set_rules you can find here