Django Javascript form validation

后端 未结 2 1173
终归单人心
终归单人心 2021-01-04 06:52

I\'d like to add js validation to my forms, and that validation should be done without requests to my server.

So, say, I open a page with form, make some errors and

相关标签:
2条回答
  • 2021-01-04 06:54

    I also thought about it and I found Django-parsley: https://github.com/agiliq/Django-parsley. It uses parsleyjs which is one the best js libraries for form validation.

    I looked at it and I'm still not satisfied since it doesn't give enough flexibility in the client side. At the end of the day I think I will be WET (write everything twice) so I'll have flexibility and I could do exactly what I want in the client side.

    0 讨论(0)
  • 2021-01-04 06:57

    I found this post in my bookmarks, but I haven't tried it out myself yet.

    http://eikke.com/django-validation-an-introduction/

    it's a small post that explains how to generate client side validation javascript from a Newform form (keeping you dry). some code is also available in a git repository

    0 讨论(0)
提交回复
热议问题