Koha/koha-tmpl/intranet-tmpl/prog/en/js
Owen Leonard c28f7d7de5 Bug 6209 [Revised] Standardize on one plugin for client-side form validation
This patch adds the jQuery "Validation" plugin
(http://docs.jquery.com/Plugins/Validation) and includes it by
default in the staff client along with an include file containing
translatable strings for all of the plugin's possible messages.

The staff client's main JavaScript file has been modified to perform
automatic validation of any form with the class "validated."

For a simple example I have modified the library entry form
to mark required fields as required (something which had not
been done before). Each required field has been given a class,
"required" and the HTML5 attribute "required." The former adds
the hook for the plugin, the latter adds browser-based validation
in recent browsers (and which will be superceded by the plugin
if JavaScript is enabled).

This will check for inputs classed "required" without any
additional configuration. More complex forms (with specific
data types, for instance) will require more inline JavaScript
configuration.

$("#FormID").validate({ /* configuration details */ });

Also added to the library entry form are checks on the email and URL
fields via classes ("email" and "url", respectively). This demonstrates
validation of content without forcing the field to be required.

To test, go to Administration -> Libraries and Groups and choose
"New library." Submit the form without entering a library code
or name. You should be prevented from submitting the form and be
shown an error message by each field. Perform the same check with an
existing entry.

To test browser-based validation, disable JavaScript and follow
the same procedure.

Revision rebases the patch against current master and adds missing
"//<![CDATA["

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Work as described with new or existing library.
No errors.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-23 00:12:36 -04:00
..
pages Bug 7596 - System prefs editor JS contains untranslatable English string 2013-03-15 19:03:49 -04:00
tinymce
acq.js Bug 8942: Translation process breaks javascript 2013-01-31 11:00:24 -05:00
additem.js Bug 8495: Fix JS error when creating a new order 2012-08-28 17:51:24 +02:00
ajax.js Bug 8942: Translation process breaks javascript 2013-01-31 11:00:24 -05:00
background-job-progressbar.js bug 6372: moved background-job.inc to background-job-progressbar.js 2012-05-07 23:00:34 +02:00
basket.js Bug 7368: Removing occurrences of dependant= feature in javascript open calls 2012-11-20 07:23:03 -05:00
cataloging.js Bug 7455: Authority subfields are cloned in the wrong field (follow-up 3) 2012-11-01 09:50:56 -04:00
datatables.js Bug 9431 [Revised] Use DataTables on Patron Category Administration page 2013-03-11 08:46:22 -04:00
jquery.jeditable.mini.js Bug 7977: Adding jEditable minified version 2012-05-24 14:14:00 +02:00
localcovers.js
members.js Bug 9284 - JavaScript should follow rules recommended by JSHint 2012-12-27 19:02:07 -05:00
staff-global.js Bug 6209 [Revised] Standardize on one plugin for client-side form validation 2013-03-23 00:12:36 -04:00
xmlControlfield.js