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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:38:23+00:00 2026-05-10T23:38:23+00:00

I have a search program that will be looking at a database from a

  • 0

I have a search program that will be looking at a database from a database. If the date range is more than 3 weeks I want to alert them that it might take a while with all the data in the database. I have a confirm message box in a JavaScript function. I want to check the date range in the aspx.cs page. how do I totrigger the message box based on that criteria? here is a copy of some of my code on html. I am not sure how to approach the checkpoint.

function warning() {                var answer = confirm('The date range you have selected will return a substantial amount of data and will take some time to process.\n\nAre you sure you want to continue?');    if (answer)       return true;    else       return false; } 
  • 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. 2026-05-10T23:38:23+00:00Added an answer on May 10, 2026 at 11:38 pm

    If the button is a submit button, then add this to the onclick(). A true return value will allow the page to continue submitting, and a false will stop the postback (submit).

    EDIT: Just try it before you say that its not right. It looks complicated but its pretty simple. Get the first date, Get the second date, compare them. If there is less than 3 weeks diff, return true and allow the page to post back (submit), else alert the user and return thier answer.

    The function…

    function warning() {                  var ele;     var startDate;     var endDate;     var threeWeeksInMilliseconds = 1814400000; //1000 ms * 60 sec * 60 min * 24 hr * 21 days      //get starting value     ele = document.getElementById('txtStartDate');     if (ele == 'undefined'){         return false; //no start element     }     else {         try{             startDate = new Date(ele.value);         }         catch (e) {             return false;         }     }      //get the ending value     ele = document.getElementById('txtEndDate');     if (ele == 'undefined'){         return false; //no start element     }     else {         try{             endDate = new Date(ele.value);         }         catch (e) {             return false;         }     }      //getTime() returns milliseconds     if ((endDate.getTime() - startDate.getTime()) < threeWeeksInMilliseconds) {         return true;     }     //else present the message for confirmation.      var msg = 'The date range you have selected will return a substantial ' + '' +             'amount of data and will take some time to process.\n\n' +              'Are you sure you want to continue?';     var answer;      answer = confirm(msg);      if (answer) {         return true;     }     else {         return false;     }      //default return condition - nothing should get here so this indicates an error.     //Use true if you want to allow this to process.      return false; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 102k
  • Answers 102k
  • 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 I created a freeware program called "Chapter and Verse" to… May 11, 2026 at 8:19 pm
  • Editorial Team
    Editorial Team added an answer In add/remove programs change the install and include ".Net Programmability".… May 11, 2026 at 8:19 pm
  • Editorial Team
    Editorial Team added an answer When you call Open on the ServiceHost, an additional thread… May 11, 2026 at 8:19 pm

Related Questions

I'm looking for a clean C++ way to parse a string containing expressions wrapped
I was looking around the internet and couldn't find a perfect algorithm for this
I am currently porting a project with a few hundred code files and dependencies
Consider I have a program that needs an environment set. It is in Perl

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.