Parsley Validation Bootstrap theme
Parsley Validation - Do parley validations on the form
HIDE CODE
<?php $xcrud = Xcrud::get_instance(); $xcrud->table('employees'); $xcrud->set_attr('lastName',array('id'=>'user','data-role'=>'admin')); //Activate parslet validation $xcrud->parsley_active(true); //Make extension mandatory $xcrud->set_attr('extension',array('required'=>'required')); //Ensure First Name is alpha numeric $xcrud->set_attr('firstName',array('data-parsley-trigger'=>'change','required'=>'required','id'=>'user','data-parsley-type'=>'alphanum')); $xcrud->set_attr('lastName',array('data-parsley-trigger'=>'change','required'=>'required','id'=>'user','data-parsley-type'=>'alphanum')); //ensure valid email and display "Email not valid" $xcrud->set_attr('email',array('data-parsley-trigger'=>'change','id'=>'user','data-parsley-type'=>'email', 'data-parsley-error-message'=>"Email not valid")); //ensure office Code is between 3 and 5 number characters $xcrud->set_attr('officeCode',array('id'=>'user','data-parsley-type'=>'digits','data-parsley-length'=>"[3,5]")); echo $xcrud->render(); ?>
Employees
# | Lastname | Firstname | Extension | Officecode | Reportsto | Jobtitle | ||
---|---|---|---|---|---|---|---|---|
1 | Hernandez | Gerardo | x2028 | gerard.hernandez@myoffice.com | 7 | 1102 | Sales Rep | View Edit Remove |
2 | Castillo | Pamela | x2759 | pcastillo@classicmodelcars.com | 4 | 1102 | Sales Rep | View Edit Remove |
3 | Bott | Larry | x2311 | lbott@classicmodelcars.com | 7 | 1102 | Sales Rep | View Edit Remove |
4 | Fixter | Andy | x101 | afixter@classicmodelcars.com | 6 | 1088 | Sales Rep | View Edit Remove |
5 | Marsh | Peter | x102 | pmarsh@classicmodelcars.com | 6 | 1088 | Sales Rep | View Edit Remove |
6 | King | Tom | x103 | tking@classicmodelcars.com | 6 | 1089 | Sales Rep | View Edit Remove |
7 | Nishi | Mami | x101 | mnishi@classicmodelcars.com | 5 | 1056 | Sales Rep | View Edit Remove |
8 | Kato | Yoshimi | x102 | ykato@classicmodelcars.com | 5 | 1621 | Sales Rep | View Edit Remove |
9 | Gerard | Martinm | x2312 | mgerard@classicmodelcars.com | 4 | 1102 | Sales Rep | View Edit Remove |
10 | aaa | aa | aa | aaaa | aaa | View Edit Remove |