Solved

calendar date picker

Posted on 2007-04-04
3
534 Views
Last Modified: 2013-11-27
Hi all,

I am using c# code behind/ASP.NET.

I need some code that will generate a "calendar date picker" ...eg i need a form with two text boxes with two calendar images next to them and when the calendar images are clicked a need a calendar to pop up and the user select a date and the date selected populates the text boxes.

If i could get this in  c# it would be great.  
If its javascript i will need details instructions on how and were to place the code because i am NOT a javascript user and dont know much about it.

so if someone could please help me it would be appreciated.

Thanks,
J
0
Comment
Question by:joan2006
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 18851394
It will HAVE to be javascript as you want things to open/close on teh client end (i.e. calendar open, populate textbox, etc)

There are many out there.

If you want one wrapped in an asp.net control you could look at:
http://www.basicdatepicker.com/

Otherwise there are free ones not in an asp.net wrapper like this:
http://www.javascriptkit.com/script/script2/tengcalendar.shtml

Instructions to use are on the page, but here is how you would use with asp:textbox

In head of page put:
<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com

</script>

In the body of the page put:

<asp:textbox id="calendar1" runat="Server" /><a href="javascript:NewCal('calendar1','MMddyyyy')"><img src="http://www.javascriptkit.com/script/script2/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>


Then on the backend you just access calendar1.Text - just like any other textbox
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 18851420
Oh you will also need to download the javascript file and place in your website.

The javascript file : datetimepicker.js
can be downloaded from the link in a zipfile, which also contains the images (so you can link to the image on your site instead of thiers, and demo pages.
0
 

Author Comment

by:joan2006
ID: 18853860
Thanks a million!!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Explain this javascript function to me 2 29
2 separate CSS animations 2 17
Where does legacy ASP.NET initialize language? 2 27
Can't get page to reload 9 14
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question