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);
Thanks,
Antonio
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();
$find('<%= WebDatePicker1.ClientID %>').setFocus();
Please let me know if you have any questions.
How come this only works for me if I put IE9 into Quirks mode?
If I try any standards mode, I get a JavaScript error saying that setFocus is null or not an object.