422 is returned when there are validation errors.
Try this
$('#jform').on('submit' , function (e) {
e.preventDefault();
data = $(this).serialize();
//alert(data);
url = $(this).attr('action');
$.ajax({
url : url,
type : 'POST' ,
data : data ,
dataType: 'json', // add this
success:function (data) {
toastr.success(data.success, 'پیام سیستم')
} ,
error: function(data) {
console.log(data); // check in console for errors
}
});
If you add dataType: 'json', it will return json. Then just check your console for validation errors.