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>

"Amazing tools. It was a wonderful experience working with your components. Using Obout was a great experience that saved a precious time to be focused on the core of my system."

Paulo Roberto Ribeiro

Random testimonial   All testimonials