Parsley form will not validate

2019-09-04 15:39发布

I've tried to duplicate the sample bootstrap/parsley form in jsfiddle with bootstrap 3 parsley 2.2.0-rc4 http://jsfiddle.net/bwolfsohn/9wfjo94w/14/

the form pops up the message: Yay, everything seems to be ok.. then errors out with:

{"error": "Shell form does not validate{'html_initial_name': u'initial-js_lib', 'form': <mooshell.forms.ShellForm object at 0x2971b90>, 'html_name': 'js_lib', 'html_initial_id': u'initial-id_js_lib', 'label': u'Js lib', 'field': <django.forms.models.ModelChoiceField object at 0x2997bd0>, 'help_text': '', 'name': 'js_lib'}{'html_initial_name': u'initial-js_wrap', 'form': <mooshell.forms.ShellForm object at 0x2971b90>, 'html_name': 'js_wrap', 'html_initial_id': u'initial-id_js_wrap', 'label': u'Js wrap', 'field': <django.forms.fields.TypedChoiceField object at 0x29974d0>, 'help_text': '', 'name': 'js_wrap'}"}

The original sample is at: http://parsleyjs.org/doc/examples/simple.html

2条回答
何必那么认真
2楼-- · 2019-09-04 15:57

I'm not too sure what that error is, but I've updated the example, hopefully it will make things clearer and better.

查看更多
乱世女痞
3楼-- · 2019-09-04 16:06

OK.. This looks like a jsfiddle problem... I manually loaded it and ran it on codepen with no problem...

http://codepen.io/bwolfsohn/pen/dGbePr

You've just POSTed to a Pen.
Values Posted
fullname    brian wolfsohn
email   brian@cus.com
gender  M
message     
Values as JSON
{"fullname":"brian wolfsohn","email":"abc@def.com","gender":"M","message":""}
查看更多
登录 后发表回答