Owen Leonard
c28f7d7de5
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> |
||
---|---|---|
.. | ||
virtualshelves/merge | ||
acquisitions-add-to-basket.inc | ||
acquisitions-menu.inc | ||
acquisitions-search.inc | ||
acquisitions-toolbar.inc | ||
additem.js.inc | ||
admin-menu.inc | ||
auth-finder-search.inc | ||
authorities-search-results.inc | ||
authorities-search.inc | ||
authorities-toolbar.inc | ||
authorities.inc | ||
biblio-default-view.inc | ||
biblio-view-menu.inc | ||
budgets-active-currency.inc | ||
budgets-admin-search.inc | ||
budgets-admin-toolbar.inc | ||
calendar.inc | ||
cat-menu.inc | ||
cat-search.inc | ||
cat-toolbar.inc | ||
cataloging-search.inc | ||
checkin-search.inc | ||
checkouts-table-footer.inc | ||
circ-menu.inc | ||
circ-menu.tt | ||
circ-search.inc | ||
cities-admin-search.inc | ||
contracts-admin-search.inc | ||
currencies-admin-search.inc | ||
datatables-strings.inc | ||
date-format.inc | ||
doc-head-close-receipt.inc | ||
doc-head-close.inc | ||
doc-head-open.inc | ||
error-messages.inc | ||
facets.inc | ||
favicon.ico | ||
file-upload.inc | ||
form-blocks.inc | ||
greybox.inc | ||
guided-reports-view.inc | ||
header.inc | ||
help-bottom.inc | ||
help-top.inc | ||
home-search.inc | ||
installer-doc-head-close.inc | ||
intranet-bottom.inc | ||
labels-menu.inc | ||
labels-toolbar.inc | ||
letters-search.inc | ||
members-menu.inc | ||
members-toolbar.inc | ||
messaging-preference-form.inc | ||
page-numbers.inc | ||
patron-search-box.inc | ||
patron-search.inc | ||
patron-title.inc | ||
patron-toolbar.inc | ||
patroncards-batches-toolbar.inc | ||
patroncards-menu.inc | ||
patroncards-toolbar.inc | ||
patrons-admin-search.inc | ||
popup-bottom.inc | ||
prefs-admin-search.inc | ||
prefs-menu.inc | ||
printers-admin-search.inc | ||
quotes-toolbar.inc | ||
quotes-upload-toolbar.inc | ||
reports-menu.inc | ||
reports-toolbar.inc | ||
resort_form.inc | ||
roadtype-admin-search.inc | ||
search_indexes.inc | ||
serials-menu.inc | ||
serials-search.inc | ||
serials-toolbar.inc | ||
stopwords-admin-search.inc | ||
subscriptions-search.inc | ||
subtypes_unimarc.inc | ||
suggestions-add-search.inc | ||
table-pager.inc | ||
tools-item-action.inc | ||
tools-menu.inc | ||
tools-nomatch-action.inc | ||
tools-overlay-action.inc | ||
validator-strings.inc | ||
vendor-menu.inc | ||
virtualshelves-toolbar.inc | ||
z3950-admin-search.inc |