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

  • Home
  • SEARCH
  • 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 8872743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:17:42+00:00 2026-06-14T18:17:42+00:00

Alright, I’ve got a RangeValidator : <asp:RangeValidator ID=DateRangeValidator runat=server ControlToValidate=DateRange ErrorMessage=The date range must

  • 0

Alright, I’ve got a RangeValidator:

<asp:RangeValidator ID="DateRangeValidator" runat="server" ControlToValidate="DateRange"
    ErrorMessage="The date range must be at least 1 day, not more than 30, and neither date can be greater than today's date."
    EnableClientScript="true" MinimumValue="1" MaximumValue="30" CssClass="errortext span9 offset2"
    Display="Dynamic" />

And as you can see the minimum is 1 and the maximum is 30.


That is validating a hidden field (it’s visible at the moment cause I’m testing):

<asp:TextBox ID="DateRange" runat="server" ClientIDMode="Static" />

And as you can see I’ve set the client ID to be static so it’s finding the control just fine.


That hidden field is populated by this JavaScript method when one of the two dates change:

$('.datepicker').change(function () {
    var startDate = new Date($('#StartDate').val());
    var endDate = new Date($('#EndDate').val());

    if (startDate > Date() || endDate > Date()) {
        $('#DateRange').val(-1);
    }
    else {
        var nDifference = endDate - startDate;
        var one_day = 1000 * 60 * 60 * 24;
        $('#DateRange').val(Math.round(nDifference / one_day) + 1);
    }

    Page_ClientValidate(null);
});

And this method is working perfectly from the perspective of setting the correct number of days difference.


When the Page_ClientValidate is called I’ve debugged it to ensure the validator is firing as expected, and it is, and it has the values I would expect. When the minimum is checked it’s grabbing 1 … and when that is compared to a value of 8 … it’s evaluating as expected … 8 is greater than or equal to 1.

However, when the maximum is checked, even though it’s grabbing 30 for the maximum … when it’s compared to a value of 8 … the expression that says 8 is less than or equal to 30 is being evaluated to false.


I really hope somebody can help me out here!

How in the world is 8 not less than 30 here?

  • 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-14T18:17:44+00:00Added an answer on June 14, 2026 at 6:17 pm

    You’re missing a Type="Integer" on your RangeValidator.

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

Sidebar

Related Questions

Alright, so I got this code for gluLookAt: lookAt = new Vector3f(-player.pos.x, -player.pos.y, -player.pos.z);
Alright when I do the code: <script type = text/javascript > document.write((new Date).getTime()); </script>
Alright SQL Server Gurus, fire up your analyzers. I have a list of titles
Alright, hoping someone can help. I've got a page used to search for employees.
Alright, quick question. A server is running in Eastern Time. PHP program needs to
Alright, this one's got me seriously stumped, after trying things out for hours with
Alright I don't see why this isnt working. It seems pretty simple. Here is
Alright so i need to open a .txt file that will be created in
Alright, so I am writing a JAR to be the back end implementation of
Alright, this is driving me nuts because my regex is working on Rubular, but

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.