Fix occasionally missing selectbox value

This commit is contained in:
Nathan Gray 2013-06-03 22:33:50 +00:00
parent 3115272e8a
commit f5ab004499

View File

@ -327,7 +327,7 @@ var et2_selectbox = et2_inputWidget.extend(
// Add the empty label // Add the empty label
if(this.options.empty_label) if(this.options.empty_label)
{ {
this._appendOptionElement("" == this.getValue() ? "selected" : "", this._appendOptionElement("" == this.value ? "selected" : "",
this.options.empty_label); this.options.empty_label);
} }
@ -567,7 +567,7 @@ var et2_selectbox = et2_inputWidget.extend(
} }
} }
if (typeof _options[key] === 'object') if (typeof _options[key] === 'object' && _options[key] != null)
{ {
// Optgroup // Optgroup
if(typeof _options[key]["label"] == 'undefined' && typeof _options[key]["title"] == "undefined") if(typeof _options[key]["label"] == 'undefined' && typeof _options[key]["title"] == "undefined")