Solved

calendar date picker

Posted on 2007-04-04
3
531 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HttpPostedFile 1 26
C# Gridview 1 32
Grunt script for Build Process 1 29
JavaScript Regex not working for 1-3 digit number?   /^\d{1,3}$/ 5 11
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
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)
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

773 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