-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
65 lines (43 loc) · 1.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Synopsis
---------------
A Django plugin/wrapper for validate.js
Restrictions
---------------
Currently only supports 'required' validation.
Installation
---------------
Grap the source and ideally your own copy of validate.js
https://github.com/txm/Django-ValidateJS
http://rickharrison.github.com/validate.js/
http://docs.jquery.com/Downloading_jQuery
Setup
---------------
Edit settings.py
To get started or testing you can 'borrow' the js asset and inline css.
In reality you will want to point to your own validate.js resource.
You will also want to apply your own css. The form inputs have a class 'error' added.
VALIDATEJS = {
'steal_js': True,
'default_css': True,
}
Add 'validatejs' to INSTALLED_APPS
INSTALLED_APPS = (
...
'validatejs',
)
Usage
---------------
In your view import the method and execute, then render.
from validatejs.methods import *
validatejs = script(form, {'form_name': 'example_form'})
return render_to_response('some_view.html', { 'form': form, 'validatejs' : validatejs })
TODO
---------------
1. Move the JS to a template
2. Add more validation types
3. Investigate RequestContext or a more background/automatic method of validation
Contact
---------------
"Andrew McGregor" <[email protected]>
http://www.txm.net
@andrewmcgregor