I have a combo box on an asp page that is being passed into a function that will create a text input box inside the drop down box for data entry.
abbreviated javascript function.
The insertAdjacentHTML call is an IE only solution so I am looking for the equivalent to place strInputCell into myDropDownList.
Todd
Code:
<select id="messageComboBoxID" size="1" style="width: 375; position:absolute;" tabindex="4" onChange="messageComboBox.processComboBoxSelect();">
<option value="Background Message No. 1" >Background Message No. 1</option>
<option value="Allow trains to come to a complete stop before boarding." >Allow trains to come to a complete stop before boarding.</option>
<option value="PLEASE BE CAREFUL... Wait for the train to stop." >PLEASE BE CAREFUL... Wait for the train to stop.</option>
<option value="NO SMOKING... Thank you for your consideration." >NO SMOKING... Thank you for your consideration.</option>
<option value="PLEASE BE CAREFUL... Stay clear of the doors." >PLEASE BE CAREFUL... Stay clear of the doors.</option>
<option value="PLEASE BE CAREFUL... Watch your step." >PLEASE BE CAREFUL... Watch your step.</option>
<option value="PLEASE BE CAREFUL... Stay behind the safety line." >PLEASE BE CAREFUL... Stay behind the safety line.</option>
<option value="Please see attendant for route information." >Please see attendant for route information.</option>
</select>
abbreviated javascript function.
Code:
function ComboBoxObject(strDropDownListID, strComboBoxName)
{
this._myDropDownList = document.getElementById(strDropDownListID);
this._myDropDownList.selectedIndex = -1;
// more code here
var strInputCellID = strDropDownListID + "_text";
var strInputCell = "<INPUT type='text' id=" + strInputCellID +
" name=" + strInputCellID +
" onblur='" + strComboBoxName + ".handleData()' " +
" onkeyup='" + strComboBoxName + ".doLookup()' " +
" style='display: none; position: absolute' value='' >";
this._myDropDownList.insertAdjacentHTML("afterEnd", strInputCell); // error here
//more code here
}
The insertAdjacentHTML call is an IE only solution so I am looking for the equivalent to place strInputCell into myDropDownList.
Todd