How do I create a POP-UP Calender in JavaScript?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divina11
    New Member
    • Aug 2007
    • 55

    How do I create a POP-UP Calender in JavaScript?

    I require to click on a calender icon which in fact brings up a pop-up calender, which I then select to populate the drop down boxes - I'm buliding a site on a hotel booking system hence require this.

    I require the following to be populated, once user selects the date from the pop-up calender:

    [HTML]Arriving
    &nbsp&nbsp<SELE CT NAME id="arriveDay" >
    <Option value="" >01</option>
    <Option value="" >02</option>
    <Option value="" >03</option>
    <Option value="" >04</option>
    </SELECT>
    <SELECT NAME id="arriveMonth ">
    <Option value="" >October 2007</option>
    <Option value="" >Noverber 2007</option>
    <Option value="" >Noverber 2007</option>
    <Option value="" >January 2008</option>
    <Option value="" >Feburary 2008</option>
    </SELECT>[/HTML]

    Also is there an easier way to write out the options for the drop down? i.e. 1..31 days
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by divina11
    I require to click on a calender icon which in fact brings up a pop-up calender, which I then select to populate the drop down boxes - I'm buliding a site on a hotel booking system hence require this.

    I require the following to be populated, once user selects the date from the pop-up calender:

    [HTML]Arriving
    &nbsp&nbsp<SELE CT NAME id="arriveDay" >
    <Option value="" >01</option>
    <Option value="" >02</option>
    <Option value="" >03</option>
    <Option value="" >04</option>
    </SELECT>
    <SELECT NAME id="arriveMonth ">
    <Option value="" >October 2007</option>
    <Option value="" >Noverber 2007</option>
    <Option value="" >Noverber 2007</option>
    <Option value="" >January 2008</option>
    <Option value="" >Feburary 2008</option>
    </SELECT>[/HTML]

    Also is there an easier way to write out the options for the drop down? i.e. 1..31 days
    Try some code first, then come here buddy !

    Debasis Jana

    Comment

    • divina11
      New Member
      • Aug 2007
      • 55

      #3
      I've tried the following however nothing is displayed:

      Code:
      <script>
      var call = new CalendarPopup();
      document.write(call);
      </script>

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Is the calendar popup a real popup window using window.open()? If it is, use window.opener to access the parent window. Use document.getEle mentById to access the object so you could have:
        [CODE=javascript]window.opener.d ocument.getElem entById("arrive Day").value=day Value;[/CODE]

        Comment

        Working...