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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:49:28+00:00 2026-05-23T10:49:28+00:00

On my asp.net form, I’d like to disable the submit button whenever its validators

  • 0

On my asp.net form, I’d like to disable the submit button whenever its validators fail—i.e., anytime Page_isValid = false—and re-enable it afterwards.

I can do this by responding to the onchange event of each control and testing for Page_isValid, but I’d much rather respond to the changing of the variable itself, or to the execution of the function that does the changing.

From my research so far, here’s what I’ve concocted:

Sys.Application.add_load(AddValidatorHandlers);

function AddValidatorHandlers() {
    var validatorList;
    try { validatorList = Page_Validators; } catch (err) { }
    if (validatorList) {
        for (i in validatorList) {
            validatorList[i].onpropertychange = function () { "MY CODE GOES HERE" };
        }
    }
}

It works, but not very efficiently. I have to loop through all the validators, and my function always fires multiple times in a row.

Is there a way I can simply (a) respond to the alteration of that Page_isValid variable? or else (b) get a list of validation groups rather than the individual validators?

Thanks!

  • 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-23T10:49:28+00:00Added an answer on May 23, 2026 at 10:49 am

    For these types of situations, I always like to put my validators next to the actual code that alters what I’m checking for.

    In your case, every time you alter your Page_isValid variable, run some logic that checks if it changed values compared to what it was previously. If it did, check if it is now True or False, and disable or enable your appropriate page elements.

    If you need to access multiple page elements, you can create an “updatePageElementsViaValidator” function and call it with true or false as a parameter using the same logic; this way, you can enable or disable entire chunks of your page with a single function call.

    This logic can be modified to suit your personal preferences, but the main point is that it’s much easier to track changes to variable values at the instance you change them as opposed to when you need to access them.

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

Sidebar

Related Questions

I have an ASP.Net form and i would like to save it into a
Here's my ASP.NET form. When I click one button it calls both jQuery functions.
I have a ASP.NET form that has a search box, with a Go button.
I want to submit a simple asp.net form in jQuery can I assume $(form[0]).submit()
How can I enable/disable an asp.net form/controls selectively or entirely from code-behind? The following
I have an ASP.NET form that takes input from a user. There's a Submit
I have an ASP.NET MVC form that may (usually does) submit a response that
I have an ASP.NET form with a cancel button that is supposed to, after
I would like to replace asp.net form validation with jQuery validation but not sure
I would like to subscribe to whatever event is fired when my ASP.NET form

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.