Commit e432b77c authored by Boris Kocherov's avatar Boris Kocherov

save schema.default for simple fields (string, number, integer)

i use it if input not filled
parent 1a7763cd
...@@ -1012,6 +1012,10 @@ ...@@ -1012,6 +1012,10 @@
} }
} }
} }
if (schema.default !== undefined) {
input.setAttribute('data-default-value', JSON.stringify(schema.default));
input.placeholder = schema.default;
}
} }
// render input end // render input end
...@@ -1648,6 +1652,8 @@ ...@@ -1648,6 +1652,8 @@
} else { } else {
json_dict[input.name] = input.value; json_dict[input.name] = input.value;
} }
} else if (input.hasAttribute('data-default-value')) {
json_dict[input.name] = JSON.parse(input.getAttribute('data-default-value'));
} }
} }
}); });
......
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