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 7887737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:39:32+00:00 2026-06-03T05:39:32+00:00

I have a repeater that holds a Radio button list, a textbox and a

  • 0

I have a repeater that holds a Radio button list, a textbox and a requiredfieldvalidator control. The Radiobuttonlist holds the following:

Meets (Value M)
Above (Value A)
Below (Value B)
N/A (Value(N/A)

The textbox is set to allow the user to input some justification for their answer, and the requiredfieldvalidator makes sure that the textbox is not empty, simple enough. However the scope has changed a bit and now the client wants the requiredfieldvalidator to fire ONLY if the answer is not “M”.

I have tried setting a Load method for the validator, however when the validator loads it has no idea what the answer is in the RBL because it is fired before the user answers. I do not think that I can do a postback, because the repeater is handled within a Modal popup and if I do a postback I am not sure what will happen. How can I set my validator to false only if the user selects something other than “Meets”?

  • 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-06-03T05:39:33+00:00Added an answer on June 3, 2026 at 5:39 am

    try this:

    java script:

    <script type="text/javascript">
        function UpdateValidator(radioID, validatorid) {
            //enabling the validator only if the checkbox is checked
            var enableValidator = $("#" + radioID).is(":checked");          
            ValidatorEnable(validatorid, enableValidator);
        }
    </script>
    

    cs code:

    protected void myRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                RadioButton rd = e.Item.FindControl("myRb") as RadioButton;
                RequiredFieldValidator rfv = e.Item.FindControl("myRfv") as RequiredFieldValidator;
                // you can just pass "this" instead of "myDiv.ClientID" and get the ID from the DOM element
                rd.Attributes.Add("onclick", "UpdateValidator('" + rd.ClientID + "','" + rfv.ClientID + "');");
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater control that generates a list of links from a SqlReader.
I have a nested repeater control that displays a list of data, in my
I have a .NET repeater control that is data-bound to a List. As part
I have a repeater control that contains an ItemTemplate containing a databound label and
I have a Repeater control that is being bound to the result of a
I have a Repeater control that loads instances of a custom control I have
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have Repeater Control and in that i have code like this <div runat=server
I have an ASP.NET repeater that shows a list of items with a delete
I have a Repeater control that is creating a dynamic amount of CheckBoxList controls

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.