Server Validation


The "ajax" validation key allows you to perform asynchronous validations on your server:

	    		
<input type="text" data-dj-validator="ajax,http://localhost:8080/system/validate">
				
	    	

You must specify the address of the server where the validation will be performed, the "request_method" property allows you to change the http method:

	    		
$(“#my-form”).djValidator({
	mode: 'function',
	request_method: 'get',
	success:
		function($form){
			alert('validation finish');
		}
});
				
	    	

The message that the field is being validated while waiting for server response will be placed.

In the case of submit mode, the sending is normally done when the validation is completed by executing the success function, in case of the function mode the success function must be declared , which will be executed at the end of the validation, the normal execution will return the value null indicating The validation is pending.


On the server

A parameter with the name "value" will arrive to server with the value to be validated, server must return a Boolean value in JSON format under the name "valid" with the result of the validation:

	    		
{
	valid: true
}