Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
How to set focus (javascript) to a WebDatepicker ?
posted

Hello,

How can i set the focus to a webdatepicker using javascript ?

 

I tried this:

var dateObj = igedit_getById(datePickerName);

        if (dateObj != null)

        {

            dateObj.setFocus();

        }

But I have an error on igedit_getById because it is unknow

And I tried this but not working:

var dateObj = $find(datePickerName);

        if (dateObj != null)

        {

            dateObj.setFocus();

        }

Thanks,

 

Antonio

 

Parents
No Data
Reply
  • 49378
    posted

    Hi Antonio,

    Thank you for posting in the community.

    As WebDatePicker is part of the new AIKIDO toolset, it can be accessed on the client through ig_controls. Alternatively you may try accessing it by its client id. Below is some sample code illustrating these approaches:


                    ig_controls.WebDatePicker1.setFocus();

                    $find('<%= WebDatePicker1.ClientID %>').setFocus();

    Please let me know if you have any questions.

Children