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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:01:24+00:00 2026-05-30T09:01:24+00:00

I have a Javascript who works well, because yesterday i get here some very

  • 0

I have a Javascript who works well, because yesterday i get here some very good solutions.
I want to know if i can extended this Javascript with another Query.
The query now, gives an alert when the number is bigger then 199. It works well.

But now i want to know, if i can get confirmbox inside for the same inputbox, when i write a number bigger then 100?
Here an example
I write the number 110 and i does get an confirm box with an Information(bla bla), and when i click Yes this number stays in the inputbox.
But when i write 200 or bigger then i does get the alert that this number is to big.
Here the code, what i get yesterday, whenn the number is bigger then 199:

    <!DOCTYPE html>
    <html lang="en">
        <head>
        <meta charset="utf-8">
        <title>Page</title>
    <script type="text/javascript">
    function minMax() {
       var min = 0;
       var mid = 99;
       var max = 199;
       var num = parseInt(document.getElementById('value_one').value);
       if (num > mid && num < max) {
           var r = confirm(num + ' n\'is greater than ' + mid+ '. Press Yes to retain it.');
           if (r == false) document.getElementById('value_one').value = "";
           return false;
       }
       if (min > num || max < num) {
           alert(num + ' n\'is not between ' + min + ' and ' + max);
           return false;
       }       
    </script>
        </head>
        <body>
        <form>
            Value: <input type='text' id="value_one"  onBlur="minMax();">
        </form>
    </body>
    </html>

Is it possible and if somebody has an idea?

  • 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-30T09:01:25+00:00Added an answer on May 30, 2026 at 9:01 am

    You can use confirm box for this instead of alert. Check the demo it on w3school.

    Try this

    <script type="text/javascript">
       function minMax() {
           var min = 0;
           var mid = 100;
           var max = 199;
           var num = parseInt(document.getElementById('value_one').value);
           if (num > mid && num < max) {
               var r = confirm(num + ' n\'is greater than ' + mid+ '. Press Yes to retain it.');
               if (r == false) document.getElementById('value_one').value = "";
               return false;
           }
           if (min > num || max < num) {
               alert(num + ' n\'is not between ' + min + ' and ' + max);
               return false;
           }       
       } 
    </script>
    

    Check the demo on jsFiddle.net.

    Hope this works out for you.

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

Sidebar

Related Questions

I have some clients who are not English speaking. They would like the JavaScript
I have some client-side JavaScript validation on a form. It works great. But I
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
I have a very similar setup to the person here: PHP Background Processes i.e
I have the code for a javascript calendar and it works perfectly as it
As those who have worked on such a project you probably know this site:
I have some troubles when using javascript code for Facebook invite friends. Details: User
I want to ask about optimisation in JavaScript if else statement.I have the code
I have Javascript that opens another window and registers a click handler for all
I have JavaScript that is doing activity periodically. When the user is not looking

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.