Add calendar to textbox

  • 9 March 2006
  • 1 reply
  • 0 views

Badge +1
I'm trying to add the calendar feature to K2 textbox, where users can select date from the calendar and date appears on the textbox.

1 reply

Badge +1
Hi,

Depends on how you want to go about achieving it.

If your happy with building your own control, I would recommend a new control that inherits the K2Textbox control and provides the calender enhancements in addition.

This article from the excellent CodeProject site, http://www.codeproject.com/aspnet/ASPNET_DateSelector.asp, shows how to build a date selector control from a standard textbox. You should just be able to replace that with the K2Textbox class and away you go.

Alternatively you could attach a javascript calander to the K2Textbox, on the client side without creating a new control. Something like http://www.dynarch.com/projects/calendar/ should be suitable for that.

The inherited control will be neater for you but it depends if that's something you want to get into.

Hope that helps.

Adam.

Reply