|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Help Debugging Script/Error in Script - IE7 vs FF: <Option> tags truncated
I'm trying to inject a set of <option> clauses into a <select>. The clauses are built from a page scrap done while this page is loading.
I've loaded prototype.js, scriptaculous.js, and prototype/main.js What I've coded for the Select is: <select name='emailNames' id='emailNames' size='4' onChange='sOnChange();'></select> My <select> box is blank in IE7 (this works fine in FF). What I see in the IE7 debugger (ieinspector's dominspector) is: <SELECT id=emailNames onchange=sOnChange(); size=4 name=emailNames _extended="true">No contact (1)</OPTION><OPTION>No Contact (2)</OPTION>... Hum, very different. My research into the '_extended="true"' has been inconclusive. Too new at this to understand all that the element.extend discussions are about. Is this a problem for my application? But the wierdest part is the 1st <option> clause has the tag truncated. Code to produce and inject the clauses is: var a = new String(); for (var i in emailTemplates) { a += "<option>" + i + "</option>"; } //$('emailNames').extend = Prototype.K; //$('emailNames').innerHTML = a; $('emailNames').update(a); //document.forms.form1.emailNames.innerHTML = a; //$('emailText').update(c); // var d = $('emailText'); //d.update(a); Can anyone tell me what is going on? Some direction to go to fix this? I'm very new to jscript and OO in general but have been coding a long time. TIA! |
|
#2
|
|||
|
|||
|
IE7 vs FF: <Option> tags truncated - fixed
Alright, I have a satisfactory workaround. In the base HTML, I wcoded a <div> in place of the <select>:
<div id='emailN'> </div> <!--select name='emailNames' id='emailNames' size='4' onChange='sOnChange();'> <option>...select a template...</option> </select--> In the js, I coded the complete <select> statement: var a = new String(); a = "<select name='emailNames' id='emailNames' size='4' onChange='sOnChange();'>"; for (var i in emailTemplates) { a += "<option>" + i + "</option>"; } a += "</select>"; $('emailN').update(a); This is working in both IE7 and FF. I am new to the worlds of OO and javascript and don't know how/why this works. I would appreciate an explaination. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Need Help Debugging Script/Error in Script - IE7 vs FF: <Option> tags truncated |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|