RadTextBox Set Read Only

6 posts, 1 answers
  1. Harry Kable
    Harry Kable avatar
    19 posts
    Member since:
    Jan 2010

    Posted 14 Apr 2010 Link to this post

    Is it possible to set (and remove) the read only property of a RadTextBox using client side script?
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Apr 2010 Link to this post

    Hello Harry,

    I tried following client-side code in my application to set the RadTextBox in ReadOnly mode.

    javascript:
     
    <script type="text/javascript">  
    function setReadOnly()  
    {  
        var TextBox1 = $find("<%= RadTextBox1.ClientID %>");  
        TextBox1._textBoxElement.readOnly = true;  
    }  
    </script>  


    Hope this helps,
    Princy.
  3. Harry Kable
    Harry Kable avatar
    19 posts
    Member since:
    Jan 2010

    Posted 14 Apr 2010 Link to this post

    Hi Princy
    Thanks for the quick and accurate reply. Works for me too.
    Is there a manual describing the various elements that make up each control or do you rely on Firebug?
    Harry
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Apr 2010 Link to this post

    Hi,

    You can find out the documentation for RadControls for ASP.NET AJAX version here.

    Also go through the following link which lists the most important properties/methods of the RadTextBox client-side object:

    RadTextBox Client Object

    -Shinu.

  5. Harry Kable
    Harry Kable avatar
    19 posts
    Member since:
    Jan 2010

    Posted 14 Apr 2010 Link to this post

    Hi Shinu
    Thanks you for your reply. However, nothing that I can see in the support documentation explaims why I should use the property _textBoxElement.
    Are you able to help?
    Thanks
    Harry
  6. Dimo
    Admin
    Dimo avatar
    8479 posts

    Posted 19 Apr 2010 Link to this post

    Hello Harry,

    _textBoxElement is a property, which is normally for internal use, that's why it is not documented officially. The standard operations aimed at the RadInput textbox controls are executed via API methods, instead of referencing the textbox DOM element directly. Setting readOnly is an exception, as it is uncommon to toggle this property client-side.

    Regards,
    Dimo
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top