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

RadInputManager with Compare Validator

8 Answers 269 Views
Input
This is a migrated thread and some comments may be shown as answers.
Chameleoki
Top achievements
Rank 2
Chameleoki asked on 21 Jan 2009, 09:38 PM
I am using RadInputManager to validate Numeric on two normal asp:textboxes to two digits (13.11 for example).  Those textboxes have a simple validation control to make sure the second value is greater than or equal to the first.  It works fine unless you go back into the field and enter something like 13.123.  The box then rounds it as it should to 13.12 but the compare validator then shows the error text (* in my case) like the compare validator has failed.  Entering two-digit numbers (ie no rounding) does not cause this to happen.

In other words, when RadInputManager rounds the number, the compare validator shows failed.

8 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 26 Jan 2009, 07:10 AM
Hi Chameleoki,

I followed your instructions but could not reproduce the described problem. You can find attached a sample website created for testing attached to this message. Try it and let me know if I am missing something important.

Sincerely yours,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chameleoki
Top achievements
Rank 2
answered on 26 Jan 2009, 07:59 AM
Thanks for the project.  I have modified it to be more like the problem I am having.  Please note it is now in VB.net

Try the following on Step 2:

1. Click the SetToZero Checkbox and then submit (then submit again)
OR
2. Put in zero and submit.
3.  Hit submit twice on the above errors and you will get the required field validator misfire

ASPX:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="InputManagerCompareValidator2.aspx.vb" Inherits="InputManagerCompareValidator2" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server" submitdisabledcontrols="true"
    <div> 
        <script type="text/javascript"
            function calculate() { 
                document.getElementById("<%= TextBox3.ClientID %>").value = parseFloat(document.getElementById("<%= TextBox1.ClientID %>").value) + parseFloat(document.getElementById("<%= TextBox2.ClientID %>").value) 
            } 
            function setToZero() {document.getElementById("<%= TextBox2.ClientID %>").value = 0.00; } 
            function disableTextBox() { document.getElementById("<%= TextBox2.ClientID %>").value = 0.00; document.getElementById("<%= TextBox2.ClientID %>").disabled = true } 
    </script> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
     
        <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0"
            <WizardSteps> 
                <asp:WizardStep runat="server" title="Step 1"
                </asp:WizardStep> 
                <asp:WizardStep runat="server" title="Step 2"
                SetToZero: <asp:CheckBox ID="cbxSetToZero" OnClick="setToZero()" runat="server" /><br /> 
                Disable: <asp:CheckBox ID="cbxDisable" OnClick="disableTextBox()" runat="server" /><br /> 
        <br /> 
    <asp:TextBox ID="TextBox1" runat="server" Enabled="false" Text="0.00"></asp:TextBox><asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox2"  
       ControlToCompare="TextBox1" ErrorMessage="!" Operator="GreaterThanEqual"></asp:CompareValidator><br /> 
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2" Text="*" /> 
    <br /> 
     
    <asp:TextBox ID="TextBox3" runat="server" Enabled="false"></asp:TextBox><br /> 
        <telerik:RadInputManager ID="RadInputManager1" runat="server" Skin="Sunset"
        <telerik:NumericTextBoxSetting DecimalDigits="2" AllowRounding="true"
            <TargetControls> 
                <telerik:TargetInput ControlID="TextBox2" /> 
            </TargetControls> 
        </telerik:NumericTextBoxSetting> 
    </telerik:RadInputManager>     
                </asp:WizardStep> 
                <asp:WizardStep ID="WizardStep3" runat="server" title="Step 3"
                </asp:WizardStep> 
            </WizardSteps> 
        </asp:Wizard> 
    </div> 
    </form> 
</body> 
</html> 
 

Codebehind:

Partial Class InputManagerCompareValidator2 
    Inherits System.Web.UI.Page 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
        If Not Page.IsPostBack Then 
            TextBox2.Attributes.Add("onBlur""calculate();"
        End If 
    End Sub 
End Class 

0
Pavel
Telerik team
answered on 28 Jan 2009, 11:03 AM
Hi Chameleoki,

I am afraid I am still not able to reproduce the problem. I have prepared a small video to illustrate how it is behaving on my end. Please take a look at it and let me know if I am missing something.

Best wishes,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chameleoki
Top achievements
Rank 2
answered on 28 Jan 2009, 06:58 PM
First off, thanks so much for going above and beyond.  I love your support and always have.

Second, your video shows the problem!

After hitting the "SetToZero" checkbox, Textbox1 and Textbox2 are the same value (0.00).  Yet when you submit, it says the GreaterThanEqual failed (the red ! exclamation point).  They are equal so it should not be saying the validation failed!  It should have gone onto the next step.
0
Pavel
Telerik team
answered on 29 Jan 2009, 07:25 AM
Hi Chameleoki,

Indeed you are right, and the validator should not fire in this case (it seems I was expecting the validator to not fire when it should and missed the obvious). In order to make it work you should set the Type property of the CompareValidator to "Double" like this:

<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox2"   
       ControlToCompare="TextBox1" ErrorMessage="!" Type="Double" Operator="GreaterThanEqual"
</asp:CompareValidator> 
 
I hope this helps.

Kind regards,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sam C
Top achievements
Rank 1
answered on 28 Apr 2010, 05:44 PM
This solution is very helpful.  But I have little bit different scenario. I am assigning values to the text boxes from above address to billing address which is same as above on radio button OnSelectedIndexChanged="RadioBillingAddress_SelectedIndexChanged" event.  After Copy the above address, If I mouse over on the billing address text boxes it shows Red on those fields  as shown in the screen shot attached.

Please advice!
Thanks,
Sam
0
Chameleoki
Top achievements
Rank 2
answered on 28 Apr 2010, 06:02 PM
Post your .aspx code and codebehind for that section and I will see what I can do!
0
Sam C
Top achievements
Rank 1
answered on 29 Apr 2010, 12:52 PM
Hi Chameleoki,

Thank you for the response. I made this form as an user control, pleasefind the code that I copied into aspx file..
--aspx File ---
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InputManager.aspx.cs"Inherits="InputManager" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Fieldset" />
        <telerik:RadInputManager ID="RadInputManager1" runat="server">
            <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1" EmptyMessage="Address" Validation-ValidationGroup="DonationsValidationGroup"
                Validation-IsRequired="true">
                <TargetControls>
                    <telerik:TargetInput ControlID="uxAddress1" />
                    <telerik:TargetInput ControlID="uxCCAddress" />
                </TargetControls>
            </telerik:TextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxBehaviorAdd2" EmptyMessage="Address2"
                Validation-ValidationGroup="DonationsValidationGroup" Validation-IsRequired="false">
                <TargetControls>
                    <telerik:TargetInput ControlID="uxAddress2" />
                </TargetControls>
            </telerik:TextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxBehaviorCity" EmptyMessage="City" Validation-ValidationGroup="DonationsValidationGroup"
                Validation-IsRequired="true">
                <TargetControls>
                    <telerik:TargetInput ControlID="uxCity" />
                    <telerik:TargetInput ControlID="uxCCity" />
                </TargetControls>
            </telerik:TextBoxSetting>
            <telerik:RegExpTextBoxSetting BehaviorID="RagExpBehavior01" EmptyMessage="ZIP" Validation-IsRequired="true"
                Validation-ValidationGroup="DonationsValidationGroup" ValidationExpression="\d{5}?"
                ErrorMessage="Invalid ZIP">
                <TargetControls>
                    <telerik:TargetInput ControlID="uxZip" />
                    <telerik:TargetInput ControlID="uxCCZip" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting>
            <telerik:RegExpTextBoxSetting BehaviorID="RagExpBehavior010" EmptyMessage="ZIP+4"
                Validation-IsRequired="false" Validation-ValidationGroup="DonationsValidationGroup"
                ValidationExpression="\d{4}?" ErrorMessage="Invalid ZIP4">
                <TargetControls>
                    <telerik:TargetInput ControlID="uxZipPlus4" />
                    <telerik:TargetInput ControlID="uxCCZipPlus4" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting>
        </telerik:RadInputManager>
        <!-- content start -->
        <asp:Panel runat="server" ID="panForm" CssClass="content">
            <telerik:RadAjaxPanel ID="RadAjaxPanelMain" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                <asp:Panel ID="uxMainPanel" runat="server">
                    <!-- Main Content -->
                    <div id="widecontent" style="width: 500px;">
                        <telerik:RadFormDecorator Skin="Default" ID="RadFormDecorator2" runat="server" />
                        <telerik:RadWindowManager ID="RadWindowManager1" Behaviors="Close" KeepInScreenBounds="true"
                            runat="server" OffsetElementID="OffsetImage" Width="800px" Height="575px">
                            <Windows>
                                <telerik:RadWindow OpenerElementID="cvcHyperLink" Title="" ID="RadWindow1" NavigateUrl="cvc.htm"
                                    runat="server">
                                </telerik:RadWindow>
                            </Windows>
                        </telerik:RadWindowManager>
                        <fieldset id="FieldSet1" visible="false" class="fieldset">
                            <div style="width: 500px;">
                                <table cellspacing="0" cellpadding="0" width="95%" border="0">
                                                    <tbody>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                <span class="astrics">*</span>Address:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxAddress1" runat="server" CssClass="fields"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                Address(line#2):
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxAddress2" runat="server" CssClass="fields"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                <span class="astrics">*</span>City:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxCity" runat="server" CssClass="fields" CausesValidation="true"
                                                                    ValidationGroup="DonationsValidationGroup"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                <span class="astrics">*</span>State:
                                                            </td>
                                                            <td class="formCell">
                                                                <telerik:RadComboBox ID="uxState" runat="server" Skin="Vista" CausesValidation="true"
                                                                    ValidationGroup="DonationsValidationGroup" CssClass="fields" Height="100px" Width="140px"
                                                                    AutoPostBack="false">
                                                                    <Items>
                                                                        <telerik:RadComboBoxItem runat="server" Value="AK" Text="AK" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="AL" Text="AL" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="AR" Text="AR" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="AZ" Text="AZ" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="CA" Text="CA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="CO" Text="CO" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="CT" Text="CT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="DC" Text="DC" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="DE" Text="DE" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="FL" Text="FL" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="GA" Text="GA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="HI" Text="HI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="IA" Text="IA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="ID" Text="ID" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="IL" Text="IL" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="IN" Text="IN" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="KS" Text="KS" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="KY" Text="KY" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="LA" Text="LA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MA" Text="MA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MD" Text="MD" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="ME" Text="ME" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MI" Text="MI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MN" Text="MN" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MO" Text="MO" Selected="true" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MS" Text="MS" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MT" Text="MT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NC" Text="NC" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="ND" Text="ND" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NE" Text="NE" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NH" Text="NH" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NJ" Text="NJ" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NM" Text="NM" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NV" Text="NV" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NY" Text="NY" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="OH" Text="OH" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="OK" Text="OK" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="OR" Text="OR" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="PA" Text="PA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="RI" Text="RI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="SC" Text="SC" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="SD" Text="SD" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="TN" Text="TN" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="TX" Text="TX" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="UT" Text="UT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="VA" Text="VA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="VT" Text="VT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WA" Text="WA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WI" Text="WI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WV" Text="WV" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WY" Text="WY" />
                                                                    </Items>
                                                                    <CollapseAnimation Type="OutQuint" Duration="200" />
                                                                </telerik:RadComboBox>
                                                                <asp:RequiredFieldValidator ID="rfvState" ControlToValidate="uxState" InitialValue="-- Select One --"
                                                                    CausesValidation="true" ValidationGroup="DonationsValidationGroup" runat="server"
                                                                    ErrorMessage="State is required.">
                                                    !</asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                <span class="astrics">*</span>ZIP:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxZip" runat="server" MaxLength="5" Size="8"></asp:TextBox>
                                                                <asp:TextBox ID="uxZipPlus4" runat="server" MaxLength="4" Size="8"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                Billing Address is the same as above Address:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:RadioButtonList ID="RadioBillingAddress" runat="server" AutoPostBack="true"
                                                                    RepeatDirection="Horizontal" OnSelectedIndexChanged="RadioBillingAddress_SelectedIndexChanged">
                                                                    <asp:ListItem Text="Yes" Value="Yes" />
                                                                    <asp:ListItem Text="No" Value="No" Selected="True" />
                                                                </asp:RadioButtonList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                Address:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxCCAddress" runat="server" MaxLength="50" CssClass="fields" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                City:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxCCity" runat="server" MaxLength="50" CssClass="fields" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                State :
                                                            </td>
                                                            <td class="formCell">
                                                                <telerik:RadComboBox ID="uxCCState" runat="server" Skin="Vista" CausesValidation="true"
                                                                    ValidationGroup="DonationsValidationGroup" CssClass="fields" Height="100px" Width="140px"
                                                                    AutoPostBack="false">
                                                                    <Items>
                                                                        <telerik:RadComboBoxItem runat="server" Value="AK" Text="AK" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="AL" Text="AL" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="AR" Text="AR" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="AZ" Text="AZ" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="CA" Text="CA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="CO" Text="CO" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="CT" Text="CT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="DC" Text="DC" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="DE" Text="DE" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="FL" Text="FL" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="GA" Text="GA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="HI" Text="HI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="IA" Text="IA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="ID" Text="ID" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="IL" Text="IL" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="IN" Text="IN" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="KS" Text="KS" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="KY" Text="KY" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="LA" Text="LA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MA" Text="MA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MD" Text="MD" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="ME" Text="ME" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MI" Text="MI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MN" Text="MN" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MO" Text="MO" Selected="true" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MS" Text="MS" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="MT" Text="MT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NC" Text="NC" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="ND" Text="ND" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NE" Text="NE" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NH" Text="NH" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NJ" Text="NJ" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NM" Text="NM" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NV" Text="NV" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="NY" Text="NY" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="OH" Text="OH" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="OK" Text="OK" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="OR" Text="OR" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="PA" Text="PA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="RI" Text="RI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="SC" Text="SC" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="SD" Text="SD" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="TN" Text="TN" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="TX" Text="TX" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="UT" Text="UT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="VA" Text="VA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="VT" Text="VT" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WA" Text="WA" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WI" Text="WI" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WV" Text="WV" />
                                                                        <telerik:RadComboBoxItem runat="server" Value="WY" Text="WY" />
                                                                    </Items>
                                                                    <CollapseAnimation Type="OutQuint" Duration="200" />
                                                                </telerik:RadComboBox>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorState" ControlToValidate="uxCCState"
                                                                    runat="server" CausesValidation="true" ValidationGroup="DonationsValidationGroup"
                                                                    ErrorMessage="Please select a State" InitialValue="-- Select One --">
                                           !</asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                ZIP:
                                                            </td>
                                                            <td class="formCell">
                                                                <asp:TextBox ID="uxCCZip" runat="server" MaxLength="5" Size="8"></asp:TextBox>
                                                                <asp:TextBox ID="uxCCZipPlus4" runat="server" MaxLength="4" Size="8"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td class="formCell" height="25">
                                                                <asp:Label ID="lblFormError" ForeColor="Red" runat="server"></asp:Label>
                                                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" CausesValidation="true"
                                                                    ValidationGroup="DonationsValidationGroup" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" colspan="2">
                                                                <span class="resetButtonSpan">
                                                                    <asp:Button ID="btnSubmit" CssClass="SubmitButton" runat="server" Text="" CausesValidation="true"
                                                                        ValidationGroup="DonationsValidationGroup" OnClick="Submit_Click" /></span>
                                                                <span class="resetButtonSpan">
                                                                    <asp:Button ID="btnClear" runat="server" CssClass="ResetButton" Text="" CausesValidation="false"
                                                                        OnClick="Reset_Click" /></span>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                            </div>
                        </fieldset>
                    </div>
                </asp:Panel>
            </telerik:RadAjaxPanel>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                    style="border: 0px;" />
            </telerik:RadAjaxLoadingPanel>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
-- Code Behind File --
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class InputManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadioBillingAddress_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (RadioBillingAddress.SelectedValue.ToString() == "Yes")
        {
            this.uxCCAddress.Text = this.uxAddress1.Text;
            this.uxCCity.Text = this.uxCity.Text;
            this.uxCCState.SelectedValue = this.uxState.SelectedValue;
            this.uxCCZip.Text = this.uxZip.Text;
            this.uxCCZipPlus4.Text = this.uxZipPlus4.Text;
        }
        else
        {
            this.uxCCAddress.Text = string.Empty;
            this.uxCCity.Text = string.Empty;
            this.uxCCState.Text = string.Empty;
            this.uxCCZip.Text = string.Empty;
            this.uxCCZipPlus4.Text = string.Empty;
        }
    }
    protected void Submit_Click(object sender, EventArgs e)
    {
       //Validate and Save the Form
    }
    protected void Reset_Click(object sender, EventArgs e)
    {
        //Clear the form
    }
}

Tags
Input
Asked by
Chameleoki
Top achievements
Rank 2
Answers by
Pavel
Telerik team
Chameleoki
Top achievements
Rank 2
Sam C
Top achievements
Rank 1
Share this question
or