Welcome Guest Search | Active Topics | Sign In | Register

How can I set focus back to a EO control after I validate it? Options
Jack.Wu
Posted: Sunday, April 4, 2010 12:24:01 AM
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?
eo_support
Posted: Sunday, April 4, 2010 2:25:06 PM
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
Jack.Wu
Posted: Monday, April 5, 2010 9:25:53 AM
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.
eo_support
Posted: Monday, April 5, 2010 9:37:07 AM
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!
Jack.Wu
Posted: Thursday, April 8, 2010 5:58:32 AM
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.
eo_support
Posted: Thursday, April 8, 2010 7:34:42 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that it works for you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.