Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ralph on Dec 09, 2008 06:42
open dhtmlx forum
more IE issues with a double entry datepicker

So now that I look a little closer, I need to be more specific with my question. Here is the layout. I am trying to have two separate date-pickers on the same page with two separate text inputs.
<div class="rows">
                                <div class="left">
                                  Arrival date:<input type="text" class="input" id="calInput1" name="calInput1" readonly="true">
                                    <script>
                      mCal = new dhtmlxCalendarObject("calInput1");
                      mCal.draw();
                  </script>
                                </div>
                                <div class="left">
                                  Departure date:<input type="text" class="input" id="calInput2" name="calInput2" readonly="true">
                                    <script>
                      mCal2 = new dhtmlxCalendarObject("calInput2");   
                      mCal2.draw();
                  </script>
                                </div>
                            </div>
Is this possible in IE? I do not have a problem in any other browser that I have tested.
Also, the original solution that you mentioned works but all of the code listed after the calendar instantiation is gone and null. It will not show after the calendar.
thank you,
Ralph
Answer posted by Support on Dec 10, 2008 02:31
To avoid this IE issue you can wrap calendar init code with window.setTimeout() function.

For example:
                         <div class="left">
                                  Arrival date:<input type="text" class="input" id="calInput1" name="calInput1" readonly="true">
                                    <script>
                                       var mCal;
                                       window.setTimeout(function () {
                                          mCal = new dhtmlxCalendarObject("calInput1");
                                          mCal.draw();
                                       },1); 
                                 </script>
                                </div>
                                <div class="left">
                                  Departure date:<input type="text" class="input" id="calInput2" name="calInput2" readonly="true">
                                 <script>
                                       var mCal2;
                                       window.setTimeout(function () {
                                          mCal2 = new dhtmlxCalendarObject("calInput2");   
                                          mCal2.draw();
                                       },1); 
                                 </script>
                                </div>
                            </div>

Or you can move this init code to bodyOnLoad event handler.