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

Block keyboard input for numeric input

1 Answer 199 Views
Input
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 08 Jun 2009, 03:44 PM
Hello,
I am not sure how to accomplish this.  I have a numeric control on a form with spin buttons.  I want to block the users from entering value directly into the text box and force them to only use the spin buttons.  I tried setting read only to true but that also disabled the spin buttons.
Thanks in advanced

John

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Jun 2009, 06:21 AM
Hi John,

Try the following approach in order to disable the input textbox and use the spin buttons for entering value.

ASPX:
 
<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" ShowSpinButtons="True">  
    <ClientEvents OnLoad="OnLoad" /> 
</telerik:RadNumericTextBox> 

JavaScript:
 
<script type="text/javascript">  
function OnLoad(sender, args)  
{  
    sender._textBoxElement.disabled = true;  
}  
</script> 

-Princy.
Tags
Input
Asked by
John
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or