Bagecochen8
New Member
I have three Select Menus which are posting into a function to get an amount through Ajax.The problem is that in all browsers the Select Menus are showing, but in Internet Explorer 8 only the Year Select Menu is showing.The following is the Javascript:\[code\] <!--START CALENDAR DROPDOWN--> <script type='text/javascript'>//<![CDATA[ (function() { var currentDate = new Date(); var calendar = [ ["January", 31], ["February", 28], ["March", 31], ["April", 30], ["May", 31], ["June", 30], ["July", 31], ["August", 31], ["September", 30], ["October", 31], ["November", 30], ["December", 31] ], cont = document.getElementById('calendar-container'); // setup var sel_year = document.createElement('select'), sel_month = document.createElement('select'), sel_day = document.createElement('select'); sel_year.setAttribute("id", "year2Sel"); sel_month.setAttribute("id", "monthSel"); sel_day.setAttribute("id", "daySel"); sel_year.setAttribute("name", "year2Sel"); sel_month.setAttribute("name", "monthSel"); sel_day.setAttribute("name", "daySel"); sel_year.setAttribute("onchange", "showRSS(document.getElementById('field2').value"); sel_month.setAttribute("onclick", "showRSS(document.getElementById('field2').value, document.getElementById('yearSel').value, this.value, document.getElementById('daySel').value )"); sel_day.setAttribute("onchange", "showRSS(document.getElementById('field2').value, document.getElementById('yearSel').value, document.getElementById('monthSel').value, this.value )"); function createOption(txt, val, selected) { var option = document.createElement('option'); option.value = http://stackoverflow.com/questions/14560442/val; option.selected = selected; option.appendChild(document.createTextNode(txt)); return option; } function clearChildren(ele) { while (ele.hasChildNodes()) { ele.removeChild(ele.lastChild); } } function recalculateDays() { var month_index = sel_month.value, df = document.createDocumentFragment(); for (var i = 1, l = calendar[month_index][1]; i <= l; i++) { var selected = (currentDate.getDate() === i) ? true : false; df.appendChild(createOption(i, i, selected)); } clearChildren(sel_day); sel_day.appendChild(df); } function generateMonths() { var df = document.createDocumentFragment(); calendar.forEach(function(info, i) { var selected = (currentDate.getMonth() === i) ? true : false; df.appendChild(createOption(info[0], i, selected)); }); clearChildren(sel_month); sel_month.appendChild(df); } sel_month.onchange = recalculateDays; generateMonths(); recalculateDays(); cont.appendChild(sel_year); cont.appendChild(sel_month); cont.appendChild(sel_day); }()); //]]> </script> <!--END CAELNDAR DROPDOWN-->\[/code\]And I am simply calling this using the HTML:\[code\]<div id="calendar-container"></div>\[/code\]Any solutions to this?