[Web] Fixes number validation in forms, fixes #882

This commit is contained in:
andre.peters
2018-01-12 08:30:54 +01:00
parent d836f688dd
commit c07e521309
3 changed files with 233 additions and 8 deletions

View File

@@ -91,12 +91,12 @@ $(document).ready(function() {
}
}
if ($(this).attr("max")) {
if ($(this).val() > $(this).attr("max")) {
if (Number($(this).val()) > Number($(this).attr("max"))) {
invalid = true;
$(this).addClass('inputMissingAttr');
} else {
if ($(this).attr("min")) {
if ($(this).val() < $(this).attr("min")) {
if (Number($(this).val()) < Number($(this).attr("min"))) {
invalid = true;
$(this).addClass('inputMissingAttr');
} else {
@@ -175,12 +175,13 @@ $(document).ready(function() {
}
}
if ($(this).attr("max")) {
if ($(this).val() > $(this).attr("max")) {
if (Number($(this).val()) > Number($(this).attr("max"))) {
alert($(this).attr("max"))
invalid = true;
$(this).addClass('inputMissingAttr');
} else {
if ($(this).attr("min")) {
if ($(this).val() < $(this).attr("min")) {
if (Number($(this).val()) < Number($(this).attr("min"))) {
invalid = true;
$(this).addClass('inputMissingAttr');
} else {