ASP.NET Calendar - Knowledge Base

« Back to Knowledge Base list

How to set focus to the textbox after date is selected?

Q:

How to set focus to the textbox after date is selected?

A:

Use the OnClientDateChanged event.


ASPX

<asp:textbox runat="server" id="txtDate" />
<obout:Calendar runat="server" 
        DatePickerMode = "true" 
        TextBoxId = "txtDate"
        DatePickerImagePath = "styles/icon2.gif" 
        OnClientDateChanged="onDateChange" />



JavaScript

<script type="text/javascript">
        function onDateChange(sender, selectedDate)
        {
                sender.Ob.focus();
        }
 </
script>

"I just experimenting with your window and I must say that I am really so impressed with it.I am currently using teleik window but after I tried yours , I made my mind to move towards yours, what I really like about your components is the really simple API and it is light on browser, I made some tests comparing window to ... one and I must say your outtakes ..."

Ferasman

Random testimonial   All testimonials