Using RadInputManager To Compare Two TextBox Controls

2 posts, 0 answers
  1. Troy
    Troy avatar
    12 posts
    Member since:
    Jan 2011

    Posted 02 Sep 2011 Link to this post

    Does anyone know if it's possible to use the RadInputManager to compare two TextBox controls the way a CompareValidator control does? I like having the warning icons in my TextBox controls and when I use the CompareValidator control, I don't get them when two TextBox's text properties are different.
  2. Tsvetina
    Tsvetina avatar
    2481 posts

    Posted 07 Sep 2011 Link to this post

    Hi Troy,

    You could use the client OnValidating event of the textbox settings to perform a comparison between the two textboxes and set the textbox value as invalid if they are different (eventArgs.set_isValid(false)).
    <telerik:RadInputManager runat="server">
        <telerik:TextBoxSetting ClientEvents-OnValidating="validating">
                <telerik:TargetInput ControlID="txt" />

    <script type="text/javascript">
        function validating(sender, eventArgs) {
            if(....) {

    Kind regards,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top