如何将validation
laravel
与jquery
我尝试使用laravel验证
$this->validate($request, [
'branch' => 'required|not_in:---Select Branch---',
'dep' => 'required|not_in:--- Select Department ---',
'txt_phone' => 'required|numeric|min:8',
'txt_ext' => 'required|min:3|max:5' ], [
'txt_phone.min' => 'Phone at least 9 characters',
'txt_phone.max' => 'Phone not be greater than 10 characters',
'txt_phone.numeric' => 'Phone must be nummeric']);
但validate
server
validate
client
jquery
[u'2.40', u'2.35', u'2.67']
[2.40, 2.35, 2.67]
{{1}}怎么办?{/ 1} >
答案 0 :(得分:0)
你可以退货
if ($validator->fails()) {
return $validator->errors();
}
返回ajax