From c6e4f4e4048a6085b829b243b295c3fc47820f8f Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 7 Nov 2016 19:36:30 +0800 Subject: webui: Fix input[type=number] validation; Add input validation styles * Fix the validation for some "input[type=number]" element; By default, the number type input only accept *integer*. By setting the 'step="any"' attribute, the float numbers are also valid. * Add form input validation styles for ":valid" and ":invalid" pseudo classes. --- fg21sim/webui/static/css/main.css | 8 ++++++++ fg21sim/webui/templates/configs.html | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'fg21sim/webui') diff --git a/fg21sim/webui/static/css/main.css b/fg21sim/webui/static/css/main.css index de2eb18..8e687ba 100644 --- a/fg21sim/webui/static/css/main.css +++ b/fg21sim/webui/static/css/main.css @@ -211,6 +211,14 @@ label, legend { font-weight: normal; } +/* Validation */ +input:valid { + border-color: #5cb85c; +} +input:invalid { + border-color: #d9534f; +} + /** * Label styles (general usage) diff --git a/fg21sim/webui/templates/configs.html b/fg21sim/webui/templates/configs.html index 8e62e06..56f6542 100644 --- a/fg21sim/webui/templates/configs.html +++ b/fg21sim/webui/templates/configs.html @@ -9,17 +9,17 @@
-
+
- +
- +
@@ -114,15 +114,15 @@
- +
- +
- +
@@ -203,11 +203,11 @@
- +
- +
@@ -283,7 +283,7 @@
- +
@@ -381,7 +381,7 @@
- +
@@ -426,13 +426,13 @@
- +
- +
-- cgit v1.2.2