Django Form验证消息未在jQuery Ajax发布的Viewa中呈现 [英] Django form validation message not render in viewa in jquery ajax post

查看:81
本文介绍了Django Form验证消息未在jQuery Ajax发布的Viewa中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了django表单,并从django视图显示在html页面中.我需要从页面中发布来自jquery ajax的数据,如果数据有效,我必须这样做,然后我的django有效获取True并执行任务并返回json值.

I have created django form and shown in the html page from django views. From the page i need to post the data from jquery ajax and i have did if data's are valid then my django valid get True and perform the task and return the json value.

但是,如果数据无效,则它将不会以常规表单提交之类的django错误消息呈现给相应的html.

But in case invalid data means it will not render to corresponding html with django error messages like normal form submission.

是否有任何方法可以使用jquery ajax post方法执行相应字段中显示的django验证消息(就像普通的django表单后验证一样).请任何人提出建议,Thnaks.

Is there any way to do django validation message shown in corresponding fields(as like normal django form post validation) with jquery ajax post method. Please anyone advise on, Thnaks.

推荐答案

django-ajax-validation

这篇关于Django Form验证消息未在jQuery Ajax发布的Viewa中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆