]> gitweb.michael.orlitzky.com - charm-bypass.git/commitdiff
index.html.in: display a special error message if origin == destination
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 3 Nov 2023 17:49:24 +0000 (13:49 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 3 Nov 2023 17:49:24 +0000 (13:49 -0400)
index.html.in

index ac8b2befd2fa04818f6e47fddf15e2ddaf101693..50131b7cf32464739fe5bccc2eb13ef695b48fac 100644 (file)
           x.setCustomValidity('');
         })
 
-        if (compute_marc_zone(src.value, dest.value) === null) {
+        if (src.value === dest.value) {
+          let err = "Origin and destination are the same!";
+          dest.setCustomValidity(err);
+        }
+        else if (compute_marc_zone(src.value, dest.value) === null) {
           let err = "Origin and destination are on different lines!";
           dest.setCustomValidity(err);
         }