]> git.cworth.org Git - zombocom-ai/commitdiff
Validate numeric code before form is submitted
authorCarl Worth <cworth@cworth.org>
Thu, 8 Dec 2022 16:45:43 +0000 (08:45 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 8 Dec 2022 16:51:28 +0000 (08:51 -0800)
The image generation script will reject any non-numeric seed as well
as any value larger than 2**32-1. So enforcing this up front at the
form will give the user a better experience.

index.html

index 6bdd28b134138d24eb8568a49a4dfb328829c79f..59d87e12135605f9c612000527ae2c1ae7e44480 100644 (file)
@@ -64,7 +64,7 @@
             <label for="code">
               Numeric code:
             </label>
-            <input id="code" type="text" autocomplete="off" placeholder="(Leave blank for random)" />
+            <input id="code" type="number" min="0" max="4294967295" autocomplete="off" placeholder="(Leave blank for random)" />
           </div>
         </div>