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

RadNumericTextBox Amount

2 Answers 57 Views
Input
This is a migrated thread and some comments may be shown as answers.
WebGeek
Top achievements
Rank 1
WebGeek asked on 19 Apr 2010, 08:02 PM
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 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Apr 2010, 08:37 PM
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.
0
WebGeek
Top achievements
Rank 1
answered on 21 Apr 2010, 03:34 PM
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> 
Tags
Input
Asked by
WebGeek
Top achievements
Rank 1
Answers by
Daniel
Telerik team
WebGeek
Top achievements
Rank 1
Share this question
or