Commit e351dc97 authored by Leigh B Stoller's avatar Leigh B Stoller

Add placeholders to input fields (inputFieldHint in the geni-lib).

parent 66e36ba7
...@@ -265,6 +265,7 @@ $(function () { ...@@ -265,6 +265,7 @@ $(function () {
var inputTemplateString = var inputTemplateString =
"<input data-fieldid='<%- fieldid %>' " + "<input data-fieldid='<%- fieldid %>' " +
" data-fieldname='<%- fieldname %>' " + " data-fieldname='<%- fieldname %>' " +
" placeholder='<%- placeholder %>' " +
" name='<%- name %>' " + " name='<%- name %>' " +
" <% if (multivalue) { %> "+ " <% if (multivalue) { %> "+
" style='display: inline-block; width: 75%' " + " style='display: inline-block; width: 75%' " +
...@@ -474,6 +475,9 @@ $(function () { ...@@ -474,6 +475,9 @@ $(function () {
} }
function GenerateInput(name, fieldIndex, details, value) function GenerateInput(name, fieldIndex, details, value)
{ {
var placeholder = details.inputFieldHint ?
details.inputFieldHint : ""
var html = inputTemplate({ var html = inputTemplate({
"fieldid" : fieldIndex, "fieldid" : fieldIndex,
"fieldname" : details.name, "fieldname" : details.name,
...@@ -481,6 +485,7 @@ $(function () { ...@@ -481,6 +485,7 @@ $(function () {
"prompt" : details.description, "prompt" : details.description,
"value" : value, "value" : value,
"multivalue" : details.multiValue, "multivalue" : details.multiValue,
"placeholder": placeholder,
}); });
if (details.multiValue) { if (details.multiValue) {
html += mvalueTemplate(); html += mvalueTemplate();
...@@ -963,8 +968,10 @@ $(function () { ...@@ -963,8 +968,10 @@ $(function () {
outerdiv.addClass('has-changes'); outerdiv.addClass('has-changes');
} }
outerdiv.addClass('has-error'); outerdiv.addClass('has-error');
// This used to have display:inline, but that did
// work with multivalue fields.
innerdiv.append('<label class="control-label" ' + innerdiv.append('<label class="control-label" ' +
'style="display: inline;" ' + 'style="padding-top: 2px;" ' +
'for="inputError">Error: ' + 'for="inputError">Error: ' +
errorMsg + '</label>'); errorMsg + '</label>');
} }
......
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