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

textbox or NumericTextBox

1 Answer 200 Views
Input
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 16 Oct 2014, 09:06 PM
I am designing a new page and decided to 100% telerik, no asp controls.  I have a question on the radTextbox, it says its HTML5 compatabile for an input type but when I put an input type of numbers and go into IE11, it still allows text in the text box, I would think this would only allow numbers.  I see there is a radNumericTextbox that achieves my numbers on textbox, but why both if they support HTML5?

<td style="width:25%;text-align:right">Est. Attendance:</td>
               <td><telerik:RadTextBox ID="txtAttendance2" runat="server" Width="80px" MaxLength="4" InputType="Number"></telerik:RadTextBox>
                   <telerik:RadNumericTextBox ID="txtAttendance" runat="server" Width="80px" MaxLength="4"></telerik:RadNumericTextBox>
               </td>

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 21 Oct 2014, 12:34 PM
Hi Kevin,

Setting the InputType of the RadTextBox to Number will make the control render an HTML input element of type number. This input element allows non-numeric characters to be entered, however, the value is disregarded as invalid. You can see the same behavior if you place a simple input element with its type attribute set to number.

<input type="number" />

As you have noticed, the behavior seen when using RadNumericTextBox is different. This is because the control performs additional client-side validation of the characters that are entered in the input. If the user attempts to enter a character that is not allowed the control disregards it and alerts the user.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Input
Asked by
Kevin
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or