|
Rank: Advanced Member Groups: Member
Joined: 5/22/2009 Posts: 33
|
Hello Sir,
I used the DatePicker control to accept 2 input dates and validate the logic as your example but I would like to know how can I set focus on the error DatePicker from client side. I can use document.all["<%=ddl_item.ClientID%>"].focus() to set focus on any object of ASP.net control. How can I set focus on EO control from client side?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Try eo_GetObject("<%=ddl_item.ClientID%>").focus(). Our control is not a single DHTML object.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 5/22/2009 Posts: 33
|
Sorry that it seems my question is not clear. I would like to have a validation for DatePicker control in the client side and doubt that how can I set focus on the DatePicker after the validation. Can you show my how to set focus back to DatePicker control? Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We do understand your question. Have you tried the code we posted in our previous reply?
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 5/22/2009 Posts: 33
|
Hello Sir,
I tried as following:
if (startDate.valueOf() > endDate.valueOf()) { errorDiv.innerHTML = "The start date must be before the end date."; eo_GetObject("<%=StartDatePicker.ClientID%>").focus(); return false; }
It works. Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great. Glad that it works for you.
Thanks!
|
|