JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 22nd, 2007, 04:12 PM
tintiger tintiger is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Location: St Marys GA
Posts: 2 tintiger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 32 m 54 sec
Reputation Power: 0
Send a message via ICQ to tintiger
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!

Reply With Quote
  #2  
Old June 25th, 2007, 06:00 AM
tintiger tintiger is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Location: St Marys GA
Posts: 2 tintiger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 32 m 54 sec
Reputation Power: 0
Send a message via ICQ to tintiger
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Need Help Debugging Script/Error in Script - IE7 vs FF: <Option> tags truncated


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway