Simple validation
This is only client-side simple javascript validation. You can use default presets or create your own RegExp.
public function simple_validation()
{
$xcrud = get_xcrud();
$xcrud->table('employees');
$xcrud->validation_required('lastName',2)->validation_required('firstName',2)->validation_required('jobTitle');
$xcrud->validation_required('email');
$xcrud->validation_pattern('email','email')->validation_pattern('extension','alpha_numeric')->validation_pattern('officeCode','natural');
$xcrud->limit(10);
$data['content'] = $xcrud->render();
return view('demos', $data);
}
Employees
| # | Lastname | Firstname | Extension | Officecode | Reportsto | Jobtitle | ||
|---|---|---|---|---|---|---|---|---|
| 1 | MUrr | DianeCC | 123 | ty89cvcvthyht@hh.com | 3333 | 855 | President64 | |
| 2 | Gerard | Martin | x2312 | ty89cvcvthyht@hh.com | 123 | Sales Rep | ||
| 3 | Ygy | Ggg | Fgbj7@hj.com | 1233 | 5 | Ff | ||
| 4 | DARA2 | DATRATRE | TANTA | dara@gmail.com | 4 | 454 | GIGIONE | |
| 5 | aaa | bbb dfghjkl | aaa@aa999a.com | 3 | aaa | |||
| 6 | er | ytu | 1 | |||||
| 7 | aa | bb | 3 | |||||
| 8 | ||||||||
| 9 |