This is a migrated thread and some comments may be shown as answers.

RadTextBox Set Read Only

5 Answers 896 Views
Input
This is a migrated thread and some comments may be shown as answers.
Harry Kable
Top achievements
Rank 1
Harry Kable asked on 14 Apr 2010, 07:01 AM
Is it possible to set (and remove) the read only property of a RadTextBox using client side script?

5 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 14 Apr 2010, 09:10 AM
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.
0
Harry Kable
Top achievements
Rank 1
answered on 14 Apr 2010, 09:29 AM
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
0
Shinu
Top achievements
Rank 2
answered on 14 Apr 2010, 11:34 AM

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.

0
Harry Kable
Top achievements
Rank 1
answered on 15 Apr 2010, 04:40 AM
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
0
Dimo
Telerik team
answered on 19 Apr 2010, 12:40 PM
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.
Tags
Input
Asked by
Harry Kable
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Harry Kable
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Dimo
Telerik team
Share this question
or