django-ajax-validation icon indicating copy to clipboard operation
django-ajax-validation copied to clipboard

Allow async ajax calls and form class to be specified as string (URL argument).

Open mrmachine opened this issue 15 years ago • 3 comments

I've written a patch that adds a semi-colon to the start of the JS so it can be included with other jquery plugins which might omit the closing semi-colon, adds async param to the validate method so that events like keyup, blur and change can trigger validation in the background while input continues, adds method param to the validate method so ajax validation can be used with GET method forms and views, allows form_class to be specified as a string so you can pass it as a URL argument or hard coded path rather than having to import the form class into urls.py. I also cleaned up white space in a few places.

The patch is available at: http://paste.pocoo.org/show/153778/

mrmachine avatar Nov 30 '09 01:11 mrmachine

I've updated the patch to fix incorrect usage of isinstance (form_class should be a subclass of django.forms.Form, not an instance) and also allow the form_class argument to be a callable that returns a form class.

http://paste.pocoo.org/show/154019/

mrmachine avatar Dec 01 '09 03:12 mrmachine

My bad, issubclass raises a TypeError if passed a function. Updated the patch to use isinstance and types.FunctionType.

http://paste.pocoo.org/show/154043/

mrmachine avatar Dec 01 '09 07:12 mrmachine

hi

salahalgamdi avatar Jan 18 '15 09:01 salahalgamdi