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

Get Original Value of radinput (numeric)

1 Answer 54 Views
Input
This is a migrated thread and some comments may be shown as answers.
Wired_Nerve
Top achievements
Rank 2
Wired_Nerve asked on 11 Mar 2014, 07:42 PM
I have a bit of code that use to work until we upgraded to the newest version of the controls.
But the ability to pull the myTextBox._orginalValue no longer works... Is there a supported method for this in the latest build of the controls?

var saveIcon = $find(gridRowSaveIcon.id);
 
               var orginalValue = myTextBox._originalValue;
               if (orginalValue.length == 0) {
                   if (myTextBox._initialValue.length != 0)
                       orginalValue = myTextBox._initialValue;
               }

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Mar 2014, 03:24 AM
Hi Warren,

Please have a look into the following code snippet to get the last updated value of the RadTextBox. 

ASPX:
<telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Demo">
</telerik:RadTextBox>
<telerik:RadButton ID="RadButton1" runat="server" Text="Click" AutoPostBack="false"
    OnClientClicked="ValueChange">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function ValueChange(sender, args) {
        var textbox = $find("<%=RadTextBox1.ClientID %>");
        var originalvalue = textbox._lastSetTextBoxValue;
        if (originalvalue.length == 0) {
            if (textbox._originalInitialValueAsText.length != 0)
                originalvalue = textbox._originalInitialValueAsText;
        }
    }
</script>

Please provide your code if it doesn't help.
Thanks,
Princy.
Tags
Input
Asked by
Wired_Nerve
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or