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

RadNumericTextBox on text Change event

1 Answer 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 02 Nov 2010, 10:57 AM
Hey everyone

i have a RadNumericTextbox inside grid edit form--
<telerik:RadNumericTextBox ID="txtQuantityE" autocomplete="off" runat="server" Skin="Hay"
                                                                EmptyMessage="Enter Quantity" SelectionOnFocus="CaretToEnd" ToolTip="Enter Quantity to place Order"
                                                                Culture="English (United States)" Height="14px" Width="141px" MaxValue="9999"
                                                                MinValue="1">
                                                                <NumberFormat GroupSeparator="" DecimalDigits="0" AllowRounding="true" KeepNotRoundedValue="false" />
                                                                <ClientEvents OnKeyPress="KeyPress" />
                                                            </telerik:RadNumericTextBox>
javascript --
function show(txtQuantityE, lblRate, lblAmount, Amount)
            {
               var txtQuantityE = $find(txtQuantityE);
               var lblRate = document.getElementById(lblRate);
               var lblAmount = document.getElementById(lblAmount);
               var Amount = document.getElementById(Amount);
               Amount.value = parseInt(txtQuantityE.get_value()) * parseInt(lblRate.innerHTML);
               lblAmount.innerHTML = parseInt(txtQuantityE.get_value()) * parseInt(lblRate.innerHTML);
            }
            function KeyPress(sender, args)
            {
                if (args.get_keyCharacter() == sender.get_numberFormat().DecimalSeparator) {
                    args.set_cancel(true);
                }
                if(args.get_keyCode() == 45)
                {
                alert("Enter non-negative numbers only");
                args.set_cancel(true);
                
            }
codebehind--
txtQauntityE.Attributes.Add("onblur", "return show('" + txtQauntityE.ClientID + "','" + lblRate.ClientID + "','" + lblAmount.ClientID + "','" + Amount.ClientID + "')");
is it possible to get the product on label on text change of textbox,by keypress event?....i want the text of label to change with text change of textbox.

Thanks
Amit

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 02 Nov 2010, 11:30 AM
Hi Amit,

Using keypress will be a little cumbersome in your case. You can use setInterval, as explained here:

http://www.telerik.com/community/forums/aspnet-ajax/input/clientevents-onkeypress-backspace-delete.aspx

Best wishes,
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
Grid
Asked by
Amit
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or