diff --git a/luci-base/htdocs/luci-static/resources/form.js b/luci-base/htdocs/luci-static/resources/form.js index 58d8f7100..ef2f18e35 100644 --- a/luci-base/htdocs/luci-static/resources/form.js +++ b/luci-base/htdocs/luci-static/resources/form.js @@ -1460,7 +1460,7 @@ var CBIListValue = CBIValue.extend({ id: this.cbid(section_id), size: this.size, sort: this.keylist, - optional: this.rmempty || this.optional, + optional: this.optional, placeholder: this.placeholder, validate: L.bind(this.validate, this, section_id) }); diff --git a/luci-base/htdocs/luci-static/resources/ui.js b/luci-base/htdocs/luci-static/resources/ui.js index db76f4530..2b4c8e033 100644 --- a/luci-base/htdocs/luci-static/resources/ui.js +++ b/luci-base/htdocs/luci-static/resources/ui.js @@ -243,7 +243,7 @@ var UISelect = UIElement.extend({ 'multiple': this.options.multi ? '' : null })); - if (this.options.optional) + if (this.options.optional || this.choices.hasOwnProperty('')) frameEl.lastChild.appendChild(E('option', { 'value': '', 'selected': (this.values.length == 0 || this.values[0] == '') ? '' : null diff --git a/luci-base/luasrc/view/cbi/dropdown.htm b/luci-base/luasrc/view/cbi/dropdown.htm index 40bd8e953..d626ced44 100644 --- a/luci-base/luasrc/view/cbi/dropdown.htm +++ b/luci-base/luasrc/view/cbi/dropdown.htm @@ -4,7 +4,7 @@ id = cbid, name = cbid, sort = self.keylist, - multi = self.multiple, + multiple = self.multiple, datatype = self.datatype, optional = self.optional or self.rmempty, readonly = self.readonly, diff --git a/luci-base/luasrc/view/cbi/lvalue.htm b/luci-base/luasrc/view/cbi/lvalue.htm index e07648835..89964563d 100644 --- a/luci-base/luasrc/view/cbi/lvalue.htm +++ b/luci-base/luasrc/view/cbi/lvalue.htm @@ -7,7 +7,7 @@ sort = self.keylist, widget = self.widget, datatype = self.datatype, - optional = self.optional or self.rmempty, + optional = self.optional, placeholder = self.placeholder } }))%>> diff --git a/luci-base/luasrc/view/cbi/mvalue.htm b/luci-base/luasrc/view/cbi/mvalue.htm index 97e40abfa..1f4f4dbcc 100644 --- a/luci-base/luasrc/view/cbi/mvalue.htm +++ b/luci-base/luasrc/view/cbi/mvalue.htm @@ -13,7 +13,7 @@ name = cbid, size = self.size, sort = self.keylist, - multi = true, + multiple = true, widget = self.widget, datatype = self.datatype, optional = self.optional or self.rmempty,