libs/web: support placeholder attribute for comboboxes, fix validation quirks with input->select transition in comboboxes
This commit is contained in:
parent
6c66d91336
commit
b35ab62ada
2 changed files with 7 additions and 1 deletions
|
@ -441,7 +441,7 @@ function cbi_combobox(id, values, def, man) {
|
||||||
var obj = document.getElementById(id)
|
var obj = document.getElementById(id)
|
||||||
var sel = document.createElement("select");
|
var sel = document.createElement("select");
|
||||||
sel.id = selid;
|
sel.id = selid;
|
||||||
sel.className = 'cbi-input-select';
|
sel.className = obj.className.replace(/cbi-input-text/, 'cbi-input-select');
|
||||||
|
|
||||||
if (obj.nextSibling) {
|
if (obj.nextSibling) {
|
||||||
obj.parentNode.insertBefore(sel, obj.nextSibling);
|
obj.parentNode.insertBefore(sel, obj.nextSibling);
|
||||||
|
@ -504,6 +504,10 @@ function cbi_combobox(id, values, def, man) {
|
||||||
//Do nothing
|
//Do nothing
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Retrigger validation in select
|
||||||
|
sel.focus();
|
||||||
|
sel.blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
function cbi_combobox_init(id, values, def, man) {
|
function cbi_combobox_init(id, values, def, man) {
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
-%>
|
-%>
|
||||||
}, '<%- if not self.rmempty and not self.optional then -%>
|
}, '<%- if not self.rmempty and not self.optional then -%>
|
||||||
<%-: -- Please choose -- -%>
|
<%-: -- Please choose -- -%>
|
||||||
|
<%- elseif self.placeholder then -%>
|
||||||
|
<%-= pcdata(self.placeholder) -%>
|
||||||
<%- end -%>', '
|
<%- end -%>', '
|
||||||
<%- if self.combobox_manual then -%>
|
<%- if self.combobox_manual then -%>
|
||||||
<%-=self.combobox_manual-%>
|
<%-=self.combobox_manual-%>
|
||||||
|
|
Loading…
Reference in a new issue