mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-11 14:37:12 +00:00
[Web] Fixes number validation in forms, fixes #882
This commit is contained in:
1 parent
d836f688dd
commit
c07e521309
3 files changed
+233
-8
No files matched your search
+5
-4
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user