Home Search Member List Faq Register Login  
UltimateEditor
Re: UltimateEditor always is focused even when setting focus on textbox

Thread Starter: goodfella   Started: 04-26-2007 1:26 PM   Replies: 2
 Karamasoft Support Forums » General Discussions » UltimateEditor » Re: UltimateEditor always is focused even when setting focus on textbox
 Printable Version    « Previous Thread   Next Thread »
  26 Apr 2007, 1:26 PM
goodfella is not online. Last active: 9/25/2008 1:32:00 AM goodfella

Top 10 Posts
Joined on 04-25-2007
Posts 42
UltimateEditor always is focused even when setting focus on textbox
Hi there,

I am trying to set focus on a textbox when a dropdown selection is made. Upon choosing the "yes" field (value 1), the txtPlacement should have focus. This works fine until I add the Editor control. It seems the editor control always takes focus, no matter what.

protected void ddlPlacement_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlPlacement.SelectedValue == "1")
        {
            txtPlacement.Enabled = true;
            SetFocus(txtPlacement);
        }
        else
        {
            txtPlacement.Enabled = false;
        }
    }

    private void SetFocus(string txtbox)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder("");

        sb.Append("<script language=\"JavaScript\">");
        sb.Append(" document.forms[0].item(\"" + txtbox + "\").focus()");
        sb.Append("</script>");

        if (!IsStartupScriptRegistered("setFocus"))
        {
            RegisterStartupScript("setFocus", sb.ToString());
        }
    }

Thanks!

  
  26 Apr 2007, 2:24 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: UltimateEditor always is focused even when setting focus on textbox
Try setting SetFocus property, which gets or sets a value that indicates whether the editor text box will be focused on page load, of your UltimateEditor control to False. Its default value is True.
  
  27 Apr 2007, 12:21 AM
goodfella is not online. Last active: 9/25/2008 1:32:00 AM goodfella

Top 10 Posts
Joined on 04-25-2007
Posts 42
Re: UltimateEditor always is focused even when setting focus on textbox
Thanks! Worked just fine... One of those things I should've tried, sorry about that Smile

Thanks again!

  
 Page 1 of 1 (3 items)
Karamasoft Support Forums » General Discussions » UltimateEditor » Re: UltimateEditor always is focused even when setting focus on textbox

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2020 Karamasoft LLC. All rights reserved.