T
Thomas
Hi,
I'm having a problem with the dynamically created inputfields in
Internet Explorer.
The situation is the following:
- I have a dynamically created table with a textbox in each Cell.
- It is possible to Add and Delete rows
- Some cells have special attributes (readonly and events)
Here's a snippet of the code:
function addRowToTable(p_vestigingnummer,
p_straat_vest,
p_huisnr_vest,
p_bus_vest,
p_postcode_vest,
p_gemeente_vest,
p_plaats_syscode_vest,
p_vanaf_vest
) {
var tbl = document.getElementById("tablename");
var lastRow = tbl.rows.length;
lastRow--;
v_row++
v_rowid = "row" + v_row;
// if theres no header row in the table, then iteration =
lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
row.setAttribute("id",v_rowid);
/*.....more cells added here......*/
var CellPostcode = row.insertCell(4);
CellPostcode.setAttribute("nowrap","");
var CellPostcodeTekst = document.createElement("input");
var Anchornode = document.createElement("a");
Anchornode.setAttribute("href","javascript:call_zoekgemeente_byID(\''p_plaats_sys_vest"
+ v_rowid + "\'',\''p_postcode_vest" + v_rowid +
"\'',\''p_gemeente_vest" + v_rowid + "\'')");
var Imagenode = document.createElement("img");
Imagenode.setAttribute("src","/images/list.gif");
Imagenode.setAttribute("border","0");
CellPostcodeTekst.setAttribute("type","text");
CellPostcodeTekst.setAttribute("name","p_postcode_vest_tmp");
CellPostcodeTekst.setAttribute("id","p_postcode_vest" +
v_rowid);
CellPostcodeTekst.setAttribute("size","3");
CellPostcodeTekst.setAttribute("value",p_postcode_vest);
//troubles CellPostcodeTekst.setAttribute("onblur","call_zoekgemeente_byID(\''p_plaats_sys_vest"
+ v_rowid + "\'',\''p_postcode_vest" + v_rowid +
"\'',\''p_gemeente_vest" + v_rowid + "\'')");
CellPostcode.appendChild(CellPostcodeTekst);
Anchornode.appendChild(Imagenode);
CellPostcode.appendChild(Anchornode);
//Cell gemeente
var Cellgemeente = row.insertCell(5);
var CellgemeenteTekst = document.createElement("input");
CellgemeenteTekst.setAttribute("type","text");
CellgemeenteTekst.setAttribute("name","p_gemeente_vest_tmp");
CellgemeenteTekst.setAttribute("id","p_gemeente_vest" +
v_rowid);
CellgemeenteTekst.setAttribute("size","20");
CellgemeenteTekst.setAttribute("value",p_gemeente_vest);
CellgemeenteTekst.setAttribute("READONLY","true"); //troubles
var Cellplaatshidden = document.createElement("hidden");
Cellplaatshidden.setAttribute("type","hidden");
Cellplaatshidden.setAttribute("name","p_plaats_sys_vest_tmp");
Cellplaatshidden.setAttribute("value",p_plaats_syscode_vest);
Cellplaatshidden.setAttribute("id","p_plaats_sys_vest" +
v_rowid);
Cellgemeente.appendChild(CellgemeenteTekst);
Cellgemeente.appendChild(Cellplaatshidden);
}
Now The problem(s) is this:
If you change the textbox "p_postcode" (which is postal code in
english - or something like that) it must invoke a function which
looks up the correct city.
This works fine in Firefox but it doesn't do a damn thing in Internet
Explorer 6. I've allready changed the onchange event to onblur but
that doesn't help.
Second problem is the readonly attribute which doesn't seem to work in
IE.
Now my question is offcourse: Why doesn't it work in Internet
Explorer? Am I dealing with a MS bug here or is there some other
explanation?
Strange thing is that a lot of other attributes work perfectly (but i
don't need those, haha, programming is fun) like disabled, style,
etc....
I's nearly impossible to change the whole code (time is running out)
so I'll have to find a fix here!
anyone have a clue?
Greetz,
Thomas
I'm having a problem with the dynamically created inputfields in
Internet Explorer.
The situation is the following:
- I have a dynamically created table with a textbox in each Cell.
- It is possible to Add and Delete rows
- Some cells have special attributes (readonly and events)
Here's a snippet of the code:
function addRowToTable(p_vestigingnummer,
p_straat_vest,
p_huisnr_vest,
p_bus_vest,
p_postcode_vest,
p_gemeente_vest,
p_plaats_syscode_vest,
p_vanaf_vest
) {
var tbl = document.getElementById("tablename");
var lastRow = tbl.rows.length;
lastRow--;
v_row++
v_rowid = "row" + v_row;
// if theres no header row in the table, then iteration =
lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
row.setAttribute("id",v_rowid);
/*.....more cells added here......*/
var CellPostcode = row.insertCell(4);
CellPostcode.setAttribute("nowrap","");
var CellPostcodeTekst = document.createElement("input");
var Anchornode = document.createElement("a");
Anchornode.setAttribute("href","javascript:call_zoekgemeente_byID(\''p_plaats_sys_vest"
+ v_rowid + "\'',\''p_postcode_vest" + v_rowid +
"\'',\''p_gemeente_vest" + v_rowid + "\'')");
var Imagenode = document.createElement("img");
Imagenode.setAttribute("src","/images/list.gif");
Imagenode.setAttribute("border","0");
CellPostcodeTekst.setAttribute("type","text");
CellPostcodeTekst.setAttribute("name","p_postcode_vest_tmp");
CellPostcodeTekst.setAttribute("id","p_postcode_vest" +
v_rowid);
CellPostcodeTekst.setAttribute("size","3");
CellPostcodeTekst.setAttribute("value",p_postcode_vest);
//troubles CellPostcodeTekst.setAttribute("onblur","call_zoekgemeente_byID(\''p_plaats_sys_vest"
+ v_rowid + "\'',\''p_postcode_vest" + v_rowid +
"\'',\''p_gemeente_vest" + v_rowid + "\'')");
CellPostcode.appendChild(CellPostcodeTekst);
Anchornode.appendChild(Imagenode);
CellPostcode.appendChild(Anchornode);
//Cell gemeente
var Cellgemeente = row.insertCell(5);
var CellgemeenteTekst = document.createElement("input");
CellgemeenteTekst.setAttribute("type","text");
CellgemeenteTekst.setAttribute("name","p_gemeente_vest_tmp");
CellgemeenteTekst.setAttribute("id","p_gemeente_vest" +
v_rowid);
CellgemeenteTekst.setAttribute("size","20");
CellgemeenteTekst.setAttribute("value",p_gemeente_vest);
CellgemeenteTekst.setAttribute("READONLY","true"); //troubles
var Cellplaatshidden = document.createElement("hidden");
Cellplaatshidden.setAttribute("type","hidden");
Cellplaatshidden.setAttribute("name","p_plaats_sys_vest_tmp");
Cellplaatshidden.setAttribute("value",p_plaats_syscode_vest);
Cellplaatshidden.setAttribute("id","p_plaats_sys_vest" +
v_rowid);
Cellgemeente.appendChild(CellgemeenteTekst);
Cellgemeente.appendChild(Cellplaatshidden);
}
Now The problem(s) is this:
If you change the textbox "p_postcode" (which is postal code in
english - or something like that) it must invoke a function which
looks up the correct city.
This works fine in Firefox but it doesn't do a damn thing in Internet
Explorer 6. I've allready changed the onchange event to onblur but
that doesn't help.
Second problem is the readonly attribute which doesn't seem to work in
IE.
Now my question is offcourse: Why doesn't it work in Internet
Explorer? Am I dealing with a MS bug here or is there some other
explanation?
Strange thing is that a lot of other attributes work perfectly (but i
don't need those, haha, programming is fun) like disabled, style,
etc....
I's nearly impossible to change the whole code (time is running out)
so I'll have to find a fix here!
anyone have a clue?
Greetz,
Thomas