Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript: Transfering DDL's with IE Compliance
    primarykey
    data
    text
    <p>How do you populate a ddl with another ddl and be compliant with Internet Explorer while still being able to transverse through the array of options to set the selected option?</p> <pre><code>/******************************************************************************* * Function: func_copy_all * Created By: A. Fulton * Created Date: 3/8/2013 * For Release or Issue: RSP5.02 * Modified Date: * Purpose: Populate city ddls and selecteds. *******************************************************************************/ function func_copy_all() { var ln_start_location = ((Number(document.getElementById('page_index').value) - 1) * Number(document.getElementById('page_size').value)) +1; for(i = ln_start_location; i &lt; (ln_total_rows + 1); i++){ //load the current city ddl with options var lo_city = document.getElementById('city_'+i); var lo_temp_city = document.getElementById('temp_city_selection'); /*For IE*/ var node = document.getElementById('city_cell_' + i); var lo_cell = document.createElement("TD"); var lo_textNode = document.createTextNode(lo_temp_city); lo_cell.appendChild(lo_textNode); node.appendChild(lo_cell); //Believe innterHTML inside a div might be a problem for IE //lo_city.innerHTML = lo_temp_city.innerHTML; //option value that needes to be selected var ls_selected_city = document.getElementById('city2_'+i).value; //Get the length of the ddl var optCount = lo_temp_city.options.length; //Traverse the array to get the index and set it to the city to selected for(var ln_j = 0; ln_j &lt; optCount; ln_j++){ if(lo_temp_city.options[ln_j].value == ls_selected_city){ //set selected and break lo_city.options[ln_j].selected = "true"; //break ln_j = optCount + 1; } } } } </code></pre> <p>I can get it to work fine with firefox if I use the innerHTML's, but not with IE? If I avoid the innerHTML's I have a text node that I cannot traverse to set the selected value.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload