hi Peers,
i am having issue capturing the value of the selected DDL using IE.
the code below works just fine in Firefox...
// Create a new drop down list -- for text box use 'input' instead of 'select'
var newDDL = document.createElement('select');
// size lenght of the DDL for both IE or Firefox
newDDL.setAttribute("style","width:300px");
//firefox
newDDL.setAttribute("width","300px");
newDDL.style.width = "300px";
newDDL.id = 'id' + elementid + ColumnElement;
newDDL.setAttribute('name','newDDL'+ elementid+ColumnElement);
// filling the DDL by ITEM array Elements
var i=0;
for (i=0;i<=rec_count;i++)
{
objOption = document.createElement('option')
objOption.text = ITEM[i]
newDDL.options.add(objOption)
}
counter++;
newDDL.onchange = show1;
both cases are giving the value selected in firefox
function 1:
function show1()
{
alert('id=' + this.getAttribute('id') + 'name = ' + this.getAttribute('name') + 'value=' + this.value );
}
function 2:
function show1()
{
alert('id=' + this.getAttribute('id') + 'name = ' + this.getAttribute('name') + 'value='+ this.getAttribute('value'));
}
any suggestion will be appreciated
thanks
i am having issue capturing the value of the selected DDL using IE.
the code below works just fine in Firefox...
// Create a new drop down list -- for text box use 'input' instead of 'select'
var newDDL = document.createElement('select');
// size lenght of the DDL for both IE or Firefox
newDDL.setAttribute("style","width:300px");
//firefox
newDDL.setAttribute("width","300px");
newDDL.style.width = "300px";
newDDL.id = 'id' + elementid + ColumnElement;
newDDL.setAttribute('name','newDDL'+ elementid+ColumnElement);
// filling the DDL by ITEM array Elements
var i=0;
for (i=0;i<=rec_count;i++)
{
objOption = document.createElement('option')
objOption.text = ITEM[i]
newDDL.options.add(objOption)
}
counter++;
newDDL.onchange = show1;
both cases are giving the value selected in firefox
function 1:
function show1()
{
alert('id=' + this.getAttribute('id') + 'name = ' + this.getAttribute('name') + 'value=' + this.value );
}
function 2:
function show1()
{
alert('id=' + this.getAttribute('id') + 'name = ' + this.getAttribute('name') + 'value='+ this.getAttribute('value'));
}
any suggestion will be appreciated
thanks
Comment