I''m creating an application that allows users to rank the top 25
college football teams. The list, on the right side, starts pre-
populated with last year''s final poll, and then on the left side there
is a select box containing all of the eligible teams. When someone
selects a team from the select, I use javascript to create a new div
with appropriate id & class attributes and re-establish the sortables
so that the new div can be dragged and dropped. In firefox this works
beautifully, but in IE it creates the new div without the associated
styles for its class (though looking at it in the IE Developer
Toolbar, it shows the div as having the proper ID and class.). The
created div is just plain text with no background color. Here''s a
code sample:
function form_tab(team_id){
// group2 is the div with the select box and where newly
created (should be) draggable divs appear.
// group1 is where the top 25 is located
// otherselect is the select box itself, named so because you
have the top 25 and then the "other" teams
// oldtab is just there to make sure we don''t have duplicates.
var othersgroup = document.getElementById(''group2'');
var pollgroup = document.getElementById(''group1'');
var newdiv = document.createElement(''div'');
var otherselect =
document.getElementById(''otherteams'');
var oldtab = document.getElementById(''item_'' +
team_id);
if (oldtab != null){
pollgroup.removeChild(oldtab);
}
newdiv.setAttribute(''id'', "item_" +
team_id);
newdiv.setAttribute(''class'', "lineitem");
newdiv.innerHTML otherselect.options[otherselect.selectedIndex].text;
othersgroup.appendChild(newdiv);
otherselect.selectedIndex = 0;
MakeSortables();
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---