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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:14:45+00:00 2026-05-11T20:14:45+00:00

I’m trying to get client-side validation running. I’ve put together a very simple test

  • 0

I’m trying to get client-side validation running. I’ve put together a very simple test – file name is aTET3.aspx:

<%@ Page Language="C#" AutoEventWireup="true" 
    CodeFile="aTET3.aspx.cs" Inherits="aTET3" %>

<!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>TEST</title>

    <script type="text/javascript">
    //<![CDATA[
    function TEST() 
    {
        alert("INSIDE TEST");
        alert("ValidatorCommonOnSubmit()=" + ValidatorCommonOnSubmit());
        alert("Page_ClientValidate()=" + Page_ClientValidate());
    }
    //]]>
    </script>
</head>

<body link="#1A548E" vlink="#1A548E" alink="#1A548E" onunload="TEST()">

<form name="appForm" method="post" action="aTET3.aspx" id="appForm" runat="server">
<asp:ValidationSummary id="appValidationSummary" 
    ValidationGroup="appValidation" 
    DisplayMode="List"
    EnableClientScript="true"
    HeaderText="Loan application not ready"
    runat="server"
    Enabled="true"
    Visible="true" 
    ShowSummary="true" />
<asp:Label ID="lblMessage" Font-Bold="true" ForeColor="Red" runat="server" />

<br />
Enter amount:

<asp:RequiredFieldValidator ID="ApplicationAmountValidator" 
    ValidationGroup="appValidation" 
    ControlToValidate="txtApplicationAmount"
    ErrorMessage="Application amount is required." 
    EnableClientScript="true" 
    Enable="true"
    Display="Dynamic"
    runat="server">+++</asp:RequiredFieldValidator>

<asp:TextBox ID="txtApplicationAmount" Columns="6" runat="server" />

<br /><br />

<asp:Button ID="btnSave" runat="server" Text="Send Application" 
     CausesValidation="true" />

</form>


</body>
</html>

The page has a single textbox with a RequiredFieldValidator. There is also a ValidationSummary control, and a submit button. (I added the TEST() method, called on Unload, to check the state of the page just before callback.) No client-side validation occurs; instead, the request is sent back to the server. If I call Validate() on the server, then I get validation.

I have tried adding ValidateRequest="true" to the Page directive with same results.

When I look at the emitted JavaScript, a few things jump out to me. Here’s part of it:

<script type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
// -->
</script>

Note that Page_ValidationActive is set to False, which means that ValidatorOnSubmit always returns true. That seems odd to me, except that I looked at ‘WebUIValidation.js’, and see that ValidatorCommonOnSubmit does not validate the page anyhow – the Page_ClientValidate() method does, but how do I get it to run?

In my TEST() method, when I manually call Page_ClientValidate(), the form does get validated client-side as expected – and the postback request is sent back to the server.

I’ve tested with both Firefox 3.0.10 and Internet Explorer 7, with same results.

What am I missing?

  • 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-11T20:14:45+00:00Added an answer on May 11, 2026 at 8:14 pm

    You have to have all the validation stuff in the same validation group. Including the button that fires the validation.

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

Sidebar

Ask A Question

Stats

  • Questions 108k
  • Answers 108k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can't reference DLLs in the GAC using NAnt (that… May 11, 2026 at 9:15 pm
  • Editorial Team
    Editorial Team added an answer It looks like Bang! Howdy has the applet download all… May 11, 2026 at 9:15 pm
  • Editorial Team
    Editorial Team added an answer "Some people, when confronted with a problem, think "I know,… May 11, 2026 at 9:15 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.