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 _vestigingnumme r,
p_straat_vest,
p_huisnr_vest,
p_bus_vest,
p_postcode_vest ,
p_gemeente_vest ,
p_plaats_syscod e_vest,
p_vanaf_vest
) {
var tbl = document.getEle mentById("table name");
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(l astRow);
row.setAttribut e("id",v_rowid) ;
/*.....more cells added here......*/
var CellPostcode = row.insertCell( 4);
CellPostcode.se tAttribute("now rap","");
var CellPostcodeTek st = document.create Element("input" );
var Anchornode = document.create Element("a");
Anchornode.setA ttribute("href" ,"javascript:ca ll_zoekgemeente _byID(\''p_plaa ts_sys_vest"
+ v_rowid + "\'',\''p_postc ode_vest" + v_rowid +
"\'',\''p_gemee nte_vest" + v_rowid + "\'')");
var Imagenode = document.create Element("img");
Imagenode.setAt tribute("src","/images/list.gif");
Imagenode.setAt tribute("border ","0");
CellPostcodeTek st.setAttribute ("type","text") ;
CellPostcodeTek st.setAttribute ("name","p_post code_vest_tmp") ;
CellPostcodeTek st.setAttribute ("id","p_postco de_vest" +
v_rowid);
CellPostcodeTek st.setAttribute ("size","3") ;
CellPostcodeTek st.setAttribute ("value",p_post code_vest);
//troubles CellPostcodeTek st.setAttribute ("onblur","call _zoekgemeente_b yID(\''p_plaats _sys_vest"
+ v_rowid + "\'',\''p_postc ode_vest" + v_rowid +
"\'',\''p_gemee nte_vest" + v_rowid + "\'')");
CellPostcode.ap pendChild(CellP ostcodeTekst);
Anchornode.appe ndChild(Imageno de);
CellPostcode.ap pendChild(Ancho rnode);
//Cell gemeente
var Cellgemeente = row.insertCell( 5);
var CellgemeenteTek st = document.create Element("input" );
CellgemeenteTek st.setAttribute ("type","text") ;
CellgemeenteTek st.setAttribute ("name","p_geme ente_vest_tmp") ;
CellgemeenteTek st.setAttribute ("id","p_gemeen te_vest" +
v_rowid);
CellgemeenteTek st.setAttribute ("size","20" );
CellgemeenteTek st.setAttribute ("value",p_geme ente_vest);
CellgemeenteTek st.setAttribute ("READONLY","tr ue"); //troubles
var Cellplaatshidde n = document.create Element("hidden ");
Cellplaatshidde n.setAttribute( "type","hidden" );
Cellplaatshidde n.setAttribute( "name","p_plaat s_sys_vest_tmp" );
Cellplaatshidde n.setAttribute( "value",p_plaat s_syscode_vest) ;
Cellplaatshidde n.setAttribute( "id","p_plaats_ sys_vest" +
v_rowid);
Cellgemeente.ap pendChild(Cellg emeenteTekst);
Cellgemeente.ap pendChild(Cellp laatshidden);
}
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 _vestigingnumme r,
p_straat_vest,
p_huisnr_vest,
p_bus_vest,
p_postcode_vest ,
p_gemeente_vest ,
p_plaats_syscod e_vest,
p_vanaf_vest
) {
var tbl = document.getEle mentById("table name");
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(l astRow);
row.setAttribut e("id",v_rowid) ;
/*.....more cells added here......*/
var CellPostcode = row.insertCell( 4);
CellPostcode.se tAttribute("now rap","");
var CellPostcodeTek st = document.create Element("input" );
var Anchornode = document.create Element("a");
Anchornode.setA ttribute("href" ,"javascript:ca ll_zoekgemeente _byID(\''p_plaa ts_sys_vest"
+ v_rowid + "\'',\''p_postc ode_vest" + v_rowid +
"\'',\''p_gemee nte_vest" + v_rowid + "\'')");
var Imagenode = document.create Element("img");
Imagenode.setAt tribute("src","/images/list.gif");
Imagenode.setAt tribute("border ","0");
CellPostcodeTek st.setAttribute ("type","text") ;
CellPostcodeTek st.setAttribute ("name","p_post code_vest_tmp") ;
CellPostcodeTek st.setAttribute ("id","p_postco de_vest" +
v_rowid);
CellPostcodeTek st.setAttribute ("size","3") ;
CellPostcodeTek st.setAttribute ("value",p_post code_vest);
//troubles CellPostcodeTek st.setAttribute ("onblur","call _zoekgemeente_b yID(\''p_plaats _sys_vest"
+ v_rowid + "\'',\''p_postc ode_vest" + v_rowid +
"\'',\''p_gemee nte_vest" + v_rowid + "\'')");
CellPostcode.ap pendChild(CellP ostcodeTekst);
Anchornode.appe ndChild(Imageno de);
CellPostcode.ap pendChild(Ancho rnode);
//Cell gemeente
var Cellgemeente = row.insertCell( 5);
var CellgemeenteTek st = document.create Element("input" );
CellgemeenteTek st.setAttribute ("type","text") ;
CellgemeenteTek st.setAttribute ("name","p_geme ente_vest_tmp") ;
CellgemeenteTek st.setAttribute ("id","p_gemeen te_vest" +
v_rowid);
CellgemeenteTek st.setAttribute ("size","20" );
CellgemeenteTek st.setAttribute ("value",p_geme ente_vest);
CellgemeenteTek st.setAttribute ("READONLY","tr ue"); //troubles
var Cellplaatshidde n = document.create Element("hidden ");
Cellplaatshidde n.setAttribute( "type","hidden" );
Cellplaatshidde n.setAttribute( "name","p_plaat s_sys_vest_tmp" );
Cellplaatshidde n.setAttribute( "value",p_plaat s_syscode_vest) ;
Cellplaatshidde n.setAttribute( "id","p_plaats_ sys_vest" +
v_rowid);
Cellgemeente.ap pendChild(Cellg emeenteTekst);
Cellgemeente.ap pendChild(Cellp laatshidden);
}
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
Comment