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 want to say that your response time is incredible... the developer we have working with the license we purchased (Grid) has reported that he is getting technical support responses in under an hour consistently (and they make sense and solve his problems). GREAT company! I will be telling others about our experience."

Scott MacDonald
Velsoft

Random testimonial   All testimonials