RadNumericTextBox Amount

3 posts, 0 answers
  1. WebGeek
    WebGeek avatar
    40 posts
    Member since:
    Dec 2006

    Posted 19 Apr 2010 Link to this post

    I would like to show a message if someone inputs an Amount larger than my MaxValue.  For example, if they inputted $300 and my max value was $299, I would like to show them a link that says something like "Click here for help".  

    Any suggestions? 
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 19 Apr 2010 Link to this post

    Hello,

    You can use the ValueChanging event for that purpose:
    <script type="text/javascript">
        function valueChanging(sender, args)
        {
            if (args.get_newValue() > sender.get_maxValue())
                alert("Ooops.");
        }
    </script>

    <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" MaxValue="299">
        <ClientEvents OnValueChanging="valueChanging" />
    </telerik:RadNumericTextBox>

    Regards,
    Daniel
    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.
  3. WebGeek
    WebGeek avatar
    40 posts
    Member since:
    Dec 2006

    Posted 21 Apr 2010 Link to this post

    Thanks - based on what you sent me I was able to show/hide panels based on the following code:
    <script type="text/javascript">  
        function valueChanging(sender, args)  
        {  
            if (args.get_newValue() > sender.get_maxValue())   
            {  
                var problempnl = document.getElementById('<%=pnlProblem.ClientID%>');  
                var contactinformationpnl = document.getElementById('<%=pnlContactInformation.ClientID%>');  
     
                if (problempnl != null)   
                {  
                    problempnl.style.visibility = "visible";  
                    contactinformationpnl.style.display = "none";  
                }  
     
            }  
              
        }  
    </script> 
Back to Top