Koha/koha-tmpl/intranet-tmpl/prog/en/includes
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
..
virtualshelves/merge
acquisitions-add-to-basket.inc Bug 5343: Link serial and acqui modules 2013-03-22 23:54:43 -04:00
acquisitions-menu.inc Bug 5339: Invoices management improvement 2012-09-18 22:42:15 +02:00
acquisitions-search.inc Bug 8143 [REVISED] Upgrade jQuery tabs to current jQueryUI version 2012-06-10 15:22:58 +02:00
acquisitions-toolbar.inc Bug 9674 - Replace YUI buttons and menu on acquisitions pages with Bootstrap 2013-03-02 12:22:07 -05:00
additem.js.inc
admin-menu.inc Bug 7440 - Remove NoZebra vestiges 2013-03-19 21:17:04 -04:00
auth-finder-search.inc Bug 9764 - Replace YUI buttons on authority search popup with Bootstrap 2013-03-21 09:55:18 -04:00
authorities-search-results.inc Bug 8870 UNIMARC authorities search doesn't display information properly 2012-10-22 17:50:06 +02:00
authorities-search.inc Bug 8692: Authorities search form does not correspond to current search query 2012-09-20 14:06:41 +02:00
authorities-toolbar.inc Bug 9675 - Replace YUI buttons on authorities home page with Bootstrap 2013-03-02 12:20:08 -05:00
authorities.inc Bug 8523: Display auth hierarchies w/all marcflavours 2012-09-21 14:52:08 +02:00
biblio-default-view.inc
biblio-view-menu.inc Bug 5357: Adds a new page for searching subscriptions 2012-09-18 22:37:11 +02:00
budgets-active-currency.inc
budgets-admin-search.inc Bug 8522 - Markup errors cause problems with customized CSS 2012-08-31 18:42:04 +02:00
budgets-admin-toolbar.inc Bug 9628 - Replace YUI buttons and menus on budgets administration pages with Bootstrap 2013-02-18 08:24:37 -05:00
calendar.inc Bug 8942: Translation process breaks javascript 2013-01-31 11:00:24 -05:00
cat-menu.inc
cat-search.inc Bug 8143 [REVISED] Upgrade jQuery tabs to current jQueryUI version 2012-06-10 15:22:58 +02:00
cat-toolbar.inc Bug 9617 - Replace YUI menu on catalog pages with Bootstrap 2013-03-02 11:58:47 -05:00
cataloging-search.inc Bug 8143 [REVISED] Upgrade jQuery tabs to current jQueryUI version 2012-06-10 15:22:58 +02:00
checkin-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
checkouts-table-footer.inc Bug 8972 - Due Date set to 100 years ago 2012-11-08 23:23:25 -05:00
circ-menu.inc Added a URI filter to encode a cardnumber for borrowers as to not break patronimage.pl 2012-08-02 14:17:10 +02:00
circ-menu.tt Bug 7955: Statistics tab for Patron checkouts 2012-06-20 21:16:50 +02:00
circ-search.inc Bug 8143 [REVISED] Upgrade jQuery tabs to current jQueryUI version 2012-06-10 15:22:58 +02:00
cities-admin-search.inc Bug 8522 - Markup errors cause problems with customized CSS 2012-08-31 18:42:04 +02:00
contracts-admin-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
currencies-admin-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
datatables-strings.inc
date-format.inc
doc-head-close-receipt.inc
doc-head-close.inc Bug 6209 [Revised] Standardize on one plugin for client-side form validation 2013-03-23 00:12:36 -04:00
doc-head-open.inc Bug 9265 - Switch to HTML5 doctype in OPAC and staff client 2013-01-31 11:47:04 -05:00
error-messages.inc
facets.inc Bug 8989 - Availability facet needs an id 2012-11-08 23:23:25 -05:00
favicon.ico
file-upload.inc
form-blocks.inc Bug 8332 follow-up: make strings translatable 2012-09-03 12:46:55 +02:00
greybox.inc
guided-reports-view.inc
header.inc Bug 7804 - Add Koha Plugin System 2013-03-20 14:49:47 -04:00
help-bottom.inc
help-top.inc Bug 9521: Move common jQuery assets to koha-tmpl/intranet-tmpl/lib 2013-02-07 00:36:27 -05:00
home-search.inc Bug 8143 [REVISED] Upgrade jQuery tabs to current jQueryUI version 2012-06-10 15:22:58 +02:00
installer-doc-head-close.inc
intranet-bottom.inc Bug 9420 [Revised] Work on Bootstrap for Koha 2013-02-15 09:04:17 -05:00
labels-menu.inc
labels-toolbar.inc Bug 9636 - Replace YUI buttons on labels pages with Bootstrap 2013-02-18 08:57:34 -05:00
letters-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
members-menu.inc Bug 8130 - attach PDF files to a patron record 2012-06-28 10:55:51 +02:00
members-toolbar.inc Bug 9420 [Revised] Work on Bootstrap for Koha: Circ toolbar 2013-02-15 09:04:17 -05:00
messaging-preference-form.inc Talking Tech Support - Phase I 2012-06-10 17:46:52 +02:00
page-numbers.inc Bug 9134: There is no previous link on the second page of the search results page 2012-12-02 09:16:58 -05:00
patron-search-box.inc
patron-search.inc Bug 9407: patrons search should match substrings 2013-01-22 18:56:23 -05:00
patron-title.inc Bug 2930 [REVISED] Put other name on checkout screen 2012-10-09 12:23:39 +02:00
patron-toolbar.inc Bug 9772 - Display Norwegian chars correctly in the patron category dropdown 2013-03-20 08:02:52 -04:00
patroncards-batches-toolbar.inc
patroncards-menu.inc
patroncards-toolbar.inc Bug 9698 - Replace YUI buttons on patron card creator manage toolbar with Bootstrap 2013-03-07 09:52:20 -05:00
patrons-admin-search.inc Bug 8522 - Markup errors cause problems with customized CSS 2012-08-31 18:42:04 +02:00
popup-bottom.inc
prefs-admin-search.inc Bug 8702: System preferences search does not allow accented letters 2012-09-26 19:02:18 +02:00
prefs-menu.inc Bug 7986 Follow Up: Update ExportWithCsvProfile 2012-10-19 17:54:23 +02:00
printers-admin-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
quotes-toolbar.inc Bug 9645 - Replace YUI buttons on the quotes management page with Bootstrap 2013-02-18 09:09:57 -05:00
quotes-upload-toolbar.inc Bug 9645 - Replace YUI buttons on the quotes management page with Bootstrap 2013-02-18 09:09:57 -05:00
reports-menu.inc
reports-toolbar.inc Bug 9625 - Replace YUI buttons and menus on reports pages with Bootstrap 2013-02-20 08:27:15 -05:00
resort_form.inc
roadtype-admin-search.inc Bug 8522 - Markup errors cause problems with customized CSS 2012-08-31 18:42:04 +02:00
search_indexes.inc Bug 9395: Problem with callnumber and standard number searches 2013-02-15 18:30:15 -05:00
serials-menu.inc Bug 7688: Change subscription numbering pattern and frequencies 2013-03-22 22:14:28 -04:00
serials-search.inc Bug 5357: Adds a new page for searching subscriptions 2012-09-18 22:37:11 +02:00
serials-toolbar.inc Bug 9627 - Replace YUI buttons and menus on serials pages with Bootstrap 2013-02-18 08:22:59 -05:00
stopwords-admin-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
subscriptions-search.inc Bug 5343: Link serial and acqui modules 2013-03-22 23:54:43 -04:00
subtypes_unimarc.inc Bug 9402: letter v between 2 option tags 2013-01-24 08:56:14 -05:00
suggestions-add-search.inc Bug 9608 - White background on header on check in 2013-02-15 07:49:13 -05:00
table-pager.inc
tools-item-action.inc
tools-menu.inc bug 9360 - Clean borrowers tool wording and layout problematic 2013-01-14 22:51:55 -05:00
tools-nomatch-action.inc
tools-overlay-action.inc
validator-strings.inc Bug 6209 [Revised] Standardize on one plugin for client-side form validation 2013-03-23 00:12:36 -04:00
vendor-menu.inc Bug 8913 [Revised] Improve acquisitions navigation 2013-02-20 09:17:21 -05:00
virtualshelves-toolbar.inc Bug 9621 - Replace YUI menu on lists pages with Bootstrap 2013-02-18 08:03:42 -05:00
z3950-admin-search.inc Bug 8522 - Markup errors cause problems with customized CSS 2012-08-31 18:42:04 +02:00