| What's the equivalent of 'setAttribute' for IE6? I think I have it but need help with the command format. |
snowweb

msg:3479563 | 7:12 am on Oct 17, 2007 (gmt 0) | Hi, The following works perfectly in ff:
elem.setAttribute("onBlur","updateField('t_',this.value,'"+recordId+"','"+escape(data_nohead)+"')");
But I need to accomodate IE6 & 7. The following works in IE7 but in IE6 is doesn't include the 4th parameter 'escape(data_nohead)': elem.onBlur = function elem(){ updateField('t_',this.value,recordId,escape(data_nohead));};
'data_nohead', is a string variable. Can someone help me please? Thanks
|
daveVk

msg:3479567 | 7:30 am on Oct 17, 2007 (gmt 0) | 'data_nohead' needs to be a global variable (as does recordId) elem.onBlur = function elem(){ updateField('t_',this.value,recordId,escape(data_nohead));}; function does not need to be named, leave red bit out, naming it the same as variable elem not a great idea?
|
snowweb

msg:3479581 | 8:01 am on Oct 17, 2007 (gmt 0) | Thanks Dave. I've corrected the function declaration by removing the name as you suggested. It now looks like this: elem.onBlur = function(){ updateField('t_',this.value,recordId,escape(data_nohead));};
Regarding the two variables, 'data_nohead' and 'recordId', I just got them alerted back to me immediately before where I used them above, and they were both present. I'm trying to understand why they need to be globals? Once data_nohead has deposited it's contents as a string in the parameters list, I should have no further need for the variable. What I'm wondering is whether I need to put that parameter (the last one), in quotes and if so, what type?
|
snowweb

msg:3479638 | 10:07 am on Oct 17, 2007 (gmt 0) | I finally found the problem. I discovered that the event handlers are case sensitive and that they have to be in lower case to work in Internet Explorer! Thanks for highlighting the problem with my naming of functions. :) Regards, peter
|
daveVk

msg:3479689 | 11:45 am on Oct 17, 2007 (gmt 0) | For the record. When the onblur occurs this is executed updateField('t_',this.value,recordId,escape(data_nohead)); the variables need to exist at this time. This differs from the setAtribute case where the value of recordId is encoded into the function.
|
Dabrowski

msg:3479780 | 2:03 pm on Oct 17, 2007 (gmt 0) | Better to use addevent for event handlers, as this will prevent overwriting any other events.
|
|
|