Bug 11333 - use jQuery validator plugin for CSV profile forms
Summary: use jQuery validator plugin for CSV profile forms
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL: tools/csv-profiles.pl
Keywords:
Depends on: 5031
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-03 17:05 UTC by Galen Charlton
Modified: 2015-06-04 23:23 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 11333: use jQuery validator plugin for CSV profiles forms (3.48 KB, patch)
2013-12-03 17:12 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 11333: use jQuery validator plugin for CSV profiles forms (3.54 KB, patch)
2013-12-04 11:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 11333: use jQuery validator plugin for CSV profiles forms (3.67 KB, patch)
2013-12-05 22:26 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-12-03 17:05:32 UTC
The patch for bug 5031 added use of the HTML5 required attributes.  The jQuery validator plugin introduced in bug 6209 should also be used, as that will add validation support for non-HTML5 browsers and will standardize the look of messages for validation errors.
Comment 1 Galen Charlton 2013-12-03 17:12:44 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2013-12-04 11:45:35 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-12-05 22:26:00 UTC
Created attachment 23326 [details] [review]
[PASSED QA] Bug 11333: use jQuery validator plugin for CSV profiles forms

This patch adds the use of the jQuery validator plugin for
the two forms (new and edit) on the CSV profiles page.  Doing
this standardizes messages that gets displayed on validation
errors.

This patch, in the process, fixes a bug where if a page has
more than one validated form, only the first such form would
get the validator plugin applied to it -- it looks like $.validate()
does not do implicit iteration.

To test:

[1] Apply the patch, then go to Tools | CSV profiles.
[2] Create a new profile, but leave the name and the MARC/SQL
    fields blank.  When you click the submit button, the form
    should not be submitted; instead, text will be displayed
    to the right of each input that lacks required input.
[3] As above, but change the profile type and verify that the form
    is not submitted unless all of the required fields are filled in.
[4] Edit an existing form, then empty the MARC/SQL field.  Try
    submitting the form; it should refuse to submit the form
    and display text saying that the field is required.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed some tabs, works nicely and as described.
Comment 4 Galen Charlton 2013-12-06 15:12:45 UTC
Pushed to master.
Comment 5 Fridolin Somers 2013-12-17 17:45:14 UTC
This patch has been pushed to 3.14.x, will be in 3.14.1