date picker

V

ven

Hello,

I found a source of datepicker who opens a new window using java to select a
date, but i saw a datepicker who doesn`t open a new window (dynamically
opened on click), and i have a question maybe there is a tutorial how to
write that datepicker?

Ven
 
M

matt.torline

Ven,
You can create a web control using the calendar control, textbox
and imagebutton. When the use selects the image button use the click
event to set the property of the calendar control to
calendar.visible=true, and after they select the date use the
calendar.SelectionChanged to hide the calendar and set the value to the
textbox. Make sure to make a public property on the control to gather
the date selected. Hope this helps.
Matt
 
P

Peter Blum

As the author of one of the most popular date pickers, Peter's Date Package
(http://www.peterblum.com/datecontrols/home.aspx), I have some knowledge
here. Naturally, I'd recommend that you purchase one of the third party
controls available. It will save you a lot of time and deliver code that has
been tested in the field. In my product, it works on many browsers and
includes validators, time entry and more. (19 controls total for $50 USD)

Here is the general idea. You cannot use the ASP.NET Calendar control
because each time you click on a date or next/prev month, it submits the
page. When you build a popup calendar inside the same window, you show an
absolutely positioned <DIV> that contains the calendar. If it submits the
page, it effectively closes the calendar. To solve this, you need a
javascript-based calendar that does not submit on each click. It is a big
task to write one. Its more complicated when you need to support more than
just Internet Explorer because Mozilla, FireFox, Netscape 7, Opera 7, Safari
and the rest have slight differences.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top