Parsley Validation

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

#LastnameFirstnameExtensionEmailOfficecodeReportstoJobtitle
Actions
1Firrelli2Jox9273asdjo.firrelli2@myoffice.com71002VP Marketing View Edit Remove
2Patterson123x4645wpatterson@classicmodelca.com71056Sales Manager (APAC) View Edit Remove
3BondurGerard2x540gbondur@classicmodelcars.com31050Sale Manager (EMEA) View Edit Remove
4BowAnthony8x5428abow@classicmodelcars.com11056Sales Manager (NA) View Edit Remove
5JenningsLesliex540ljennings@classicmodelcars.com51143Sales Rep 2 View Edit Remove
6ThompsonLesliex4065lthompson@classicmodelcars.com11143Sales Rep 3 View Edit Remove
7FirrelliJuliex2173jfirrelli@classicmodelcars.com21143Sales Rep View Edit Remove
8PattersonStevex4334spatterson@classicmodelcars.com21143Sales Rep View Edit Remove
9TsengFoon Yueo224ftseng@classicmodelcars.com1231143Sales Rep View Edit Remove
10VanaufGeorge Nx4102gvanauf@classicmodelcars.com31143Sales Rep View Edit Remove
Search