Commit d69d871d authored by Boris Kocherov's avatar Boris Kocherov

use default value for string and number

parent 5e846aff
...@@ -710,8 +710,14 @@ ...@@ -710,8 +710,14 @@
} }
if (type === "integer" || type === "number") { if (type === "integer" || type === "number") {
if (default_value === undefined && typeof json_field.default === "number") {
input.value = json_field.default;
}
input.type = "number"; input.type = "number";
} else { } else {
if (default_value === undefined && typeof json_field.default === "string") {
input.value = json_field.default;
}
input.type = "text"; input.type = "text";
if (json_field.pattern) { if (json_field.pattern) {
input.pattern = json_field.pattern; input.pattern = json_field.pattern;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment