Welcome Guest Search | Active Topics | Sign In | Register

Masked Editor Options
Avtar Seehra
Posted: Friday, November 28, 2008 11:04:34 AM
Rank: Newbie
Groups: Member

Joined: 11/12/2008
Posts: 6
Hi,
I am using a masked editor and have setup a mask. On page load, I want to set focus on this editor. But when it loads, the cursor is at the end of the editor and the user has to click on the textbox to get it highlited to be able to enter the data.

In my aspx page:
<eo:MaskedEdit ID="meTxtID" runat="server" PromptChar="" CssClass="maskEditorText" Width="220px" >
<eo:MaskedEditSegment Mask="0000000000" SegmentType="MASK" />
</eo:MaskedEdit>

On PageLoad event
protected void Page_Load(object sender, EventArgs e)
{
meTxtID.Focus();
}
eo_support
Posted: Friday, November 28, 2008 12:19:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
Hi,

You can do it by following these steps:

1. In your Page_Load, set the focus to another control, for example:

Code: C#
TextBox1.Focus();


2. Add the following JavaScript code to the end of your page after the </form> closing tag:

Code: JavaScript
window.setTimeout(
    function()
    {
        document.getElementById("meTxtID").focus();
    }, 10);


Please let us know if this 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.