Koha/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc
Katrin Fischer 6b2308c17b
Bug 34169: Use jQuery validator plugin to validate amounts
This is a first step towards more consistency and possibly supporting
multiple input formats as well in the future. It allows us to mark all
input fields for monetary values, such as prices, replacement prices,
fees etc. with a class that is linked to a check for the 'number' format
in the jQuery Validator plugin.

This is the base patch that does nothing by itself, please see
test plan in second patch.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-24 14:55:34 -03:00

25 lines
1.4 KiB
SourcePawn

<!-- validator-strings.inc -->
<script>
$(document).ready(function(){
jQuery.extend(jQuery.validator.messages, {
required: _("This field is required."),
remote: _("Please fix this field."),
email: _("Please enter a valid email address."),
url: _("Please enter a valid URL."),
date: _("Please enter a valid date."),
dateISO: _("Please enter a valid date (ISO)."),
number: _("Please enter a valid number."),
digits: _("Please enter only digits."),
equalTo: _("Please enter the same value again."),
number: _("Please add amount in valid format: 0.00"),
maxlength: $.validator.format(_("Please enter no more than {0} characters.")),
minlength: $.validator.format(_("Please enter at least {0} characters.")),
rangelength: $.validator.format(_("Please enter a value between {0} and {1} characters long.")),
range: $.validator.format(_("Please enter a value between {0} and {1}.")),
max: $.validator.format(_("Please enter a value less than or equal to {0}.")),
min: $.validator.format(_("Please enter a value greater than or equal to {0}.")),
phone: $.validator.format(_("Please enter a valid phone number."))
});
});
</script>
<!-- / validator-strings.inc -->