By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

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

P: 55
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<SELECT 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
Oct 12 '07 #1
Share this Question
Share on Google+
3 Replies


dmjpro
100+
P: 2,476
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<SELECT 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
Oct 12 '07 #2

P: 55
I've tried the following however nothing is displayed:

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. var call = new CalendarPopup();
  3. document.write(call);
  4. </script>
Oct 12 '07 #3

acoder
Expert Mod 15k+
P: 16,027
Is the calendar popup a real popup window using window.open()? If it is, use window.opener to access the parent window. Use document.getElementById to access the object so you could have:
Expand|Select|Wrap|Line Numbers
  1. window.opener.document.getElementById("arriveDay").value=dayValue;
Oct 15 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.