Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7684999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:09:21+00:00 2026-05-31T19:09:21+00:00

Arg. Inheriting projects is SO much fun. Especially when they don’t work well, and

  • 0

Arg. Inheriting projects is SO much fun. Especially when they don’t work well, and even more especially when they contain UpdatePanels…

I have a shipping address user control inside an UpdatePanel. We need to be able to process international addresses, so one thing I’ve done is show/hide the State dropdown depending on if the country selected is US or not. In addition, I have a RequiredFieldValidator on that dropdown.

When the user control is used on a normal page elsewhere in the application, everything is great. However, in the UpdatePanel, .NET is not seeing the RFV even though JavaScript does.

Address.ascx: (snipped)

    <li class="form-list-question question-state">
        <span class="form-label">
          <asp:Label ID="lblState" runat="server" SkinID="FieldLabel" AssociatedControlID="ddlState" Text="State" /></span>
        <asp:DropDownList ID="ddlState" runat="server" SkinID="State" DataSourceID="dsStates" AppendDataBoundItems="true" ViewStateMode="Enabled"
        DataTextField="Name" DataValueField="Abbr" CssClass="required">
            <asp:ListItem Text="" Value=""></asp:ListItem>
        </asp:DropDownList>
        <asp:RequiredFieldValidator ID="rfvState" runat="server" EnableClientScript="true" Display="None" ControlToValidate="ddlState"
        ErrorMessage="State is required." ValidationGroup="Address" />
    </li>

address.js: (snipped)

        function SetFormByCountry() {
    if (isUsTerritory()) {
        $('.question-state').show();
        if ($('#rfvState').length > 0) {
            $('#rfvState').enabled = true;
        }
    } else {
        $('.question-state').hide();
        if ($('#rfvState').length > 0) {
            $('#rfvState').enabled = false;
        }
    }
}

Current behavior: When a country other than the US is selected, the State dropdown disappears as appropriate, but when the form is submitted, validation still occurs on the now hidden dropdown. There are no JS errors created.

Expected behavior: Given the above scenario, the RequiredFieldValidator should be disabled and the form should post.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:09:23+00:00Added an answer on May 31, 2026 at 7:09 pm

    Have you tried using the ValidatorEnable function?

    It’s an ASP.Net javascript function that can be used to turn off client side validators; in your example, you should be able to do the following in your client side javascript (where you set the enabled property):

    ValidatorEnable(document.getElementById('<%=rfvState.ClientID%>'), false);
    

    My only other suggestion is to fire a async postback when the country is changed and remove the state validator server side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why doesn't the following work: class CTest(tuple): def __init__(self,arg): if type(arg) is tuple: super(CTest,self).__init__((2,2))
I need to calculate the number of integers in an arg as well as
Imagine the following situation: struct Args { bool arg; }; void thing(Args arg) {
Here's the code snippet: public static void main (String[]arg) { char ca = 'a'
println args println args.size() println args.each{arg-> println arg} println args.class if (args.contains(Hello)) println Found
Assume the following function prototype: void *function(int arg) . Is that a pointer to
I of course know that I can rename the init arg for an attribute
I have following code public class TEST { public static void main(String arg[]){ try
I'm not sure I am using ad-get-args and ad-get-arg right. For example, the following
I was recently asked in an exam if public static void main(String arg[]) format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.