我提交的表格包括:
<textarea name="entry" cols="40" rows="10" placeholder="Entry context..." class="area-fld" maxlength="30" required id="id_entry"> # CSS CSS is a language that can be used to add style to an [HTML](/wiki/HTML) page. </textarea>
此代码:
def new(request): if request.method == "POST": form = NewEntry(request.POST) if form.is_valid():
form.is_valid()
为False!
所有其他字段均为OK值。我发现问题在于文本区域中的值。
我需要在服务器端检查表单验证(必填字段),但上面的值必须得到批准。
-
form.is_valid()
的要点是什么? - 哪些值不被批准?
- 如何处理这个问题?
我已经阅读了Django文档