-
Notifications
You must be signed in to change notification settings - Fork 57
/
README
64 lines (49 loc) · 2.83 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
---------------------------------------------------------------------------
ABOUT
---------------------------------------------------------------------------
LiveValidation is a small javascript library for performing validations,
and also to link these validations up to form fields, to give users
real-time feedback of the validity of their data.
---------------------------------------------------------------------------
USAGE
---------------------------------------------------------------------------
To use the script you must first choose which flavour to use (prototype.js
or standalone versions).
If you are using prototype.js in your project already then use the
prototype version, but if you do not already use it, it is recommended to
use the standalone version. You can always switch to the prototype version
at a later stage without changing any of the validation code you have
written, if you decide you want to use it for other purposes too.
Whichever route you choose, you should add the javascript files to a
directory of your website, usually something like /javascripts.
Then you must include the javascript in the head of the web page document
that you wish to perform validation in. Here is an example of how to do it
for each version, paste this into the head:
For standalone version:
-----------------------
<script type="text/javascript" src="javascripts/livevalidation_standalone.js"></script>
For prototype.js version:
-------------------------
<script type="text/javascript" src="javascripts/prototype.js"></script>
<script type="text/javascript" src="javascripts/livevalidation_prototype.js"></script>
Then you must wire up your validations to the form fields. For details of
how to do this, visit the examples page of the LiveValidation website
(http://www.livevalidation.com/examples), and the documentation page too
(http://www.livevalidation.com/documentation). The way you do this is the
same for both versions.
---------------------------------------------------------------------------
DISTRIBUTION
---------------------------------------------------------------------------
In addition to the source of LiveValidation, this distribution also
includes various test suites (using prototype.js and script.aculo.us) to
test that the code works as it should. There are also functional tests that
serve as another way to test the code, and also to provide examples of
LiveValidation's functionality.
To run these tests open test/run_unit_tests.html, and
test/run_functional_tests.html in a browser, and select a version to test
from the menu on the left hand side.
---------------------------------------------------------------------------
LICENSE
---------------------------------------------------------------------------
LiveValidation is licensed under the terms of the MIT License (see the
included MIT-LICENSE for details).