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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:27:11+00:00 2026-05-30T23:27:11+00:00

I am not very well in Java Script and i didn’t found a solution

  • 0

I am not very well in Java Script and i didn’t found a solution for my problem.

I have a textbox on my page where inside i am authorized to write a number between 0 and 199.

If i write 200 or >, then i want to get an alert (onblur).

I found a code who is very interesting and maybe useful.

But I don’t know if he works, because I don’t know how to implement this.

<script>
    var min = 0;
    var max = 199;
    var num = parseInt(myform.numfield.value);
    if (min > num || max < num) {
        alert(num + ' is not between ' + min + ' and ' + max);
        return false;
    }
</script>

I Hope you can help me

Here the new code who works

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
        <meta charset="utf-8"> 
        <title>Page</title> 
        <script type="text/javascript">
            function check(min, max) {
                var num = parseInt(document.getElementById('value_one').value);
                if (min > num || max < num)
                {
                    alert(num + ' ist nicht zwischen ' + min + ' und ' + max);
                }
            }
        </script> 
    </head> 
    <body> 
        <form> 
            Zahl: <input type='text' id='value_one' onBlur="check(0, 100)" > 
        </form> 
    </body> 
</html>

I have also another question. Is it possible to add to the same function a query, where, when I write a number bigger than 99 into the same Textbox, where we have the query of MIN and MAX, to get an alert with a Message “Now we get new values”, but still when I write 200 or bigger, to get the Message like before. Is it possible? Thank you very much so late for your help. Cheers

  • 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-30T23:27:12+00:00Added an answer on May 30, 2026 at 11:27 pm

    I would put this code into a function, and then call it onblur:

    function check(min, max) {
        var num = parseInt(this.value);
        if (min > num || max < num) {
            alert(num + ' is not between ' + min + ' and ' + max);
        }
    }
    

    and then

    <input type='text' onblur="check(0, 199)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry this is not a very well defined question, I am thinking about an
I've searched, but I've not understood very well these three concepts. When do I
Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord
Not very technical, but... I have to implement a bad words filter in a
i'm not very well-versed with javascript, so please bear with me. i've a form
Please excuse my ignorance I am not very familiar with JavaScript and have been
I have one paragraph of javascript code. And i don't understand it very well.
So, I have page where a PHP script echoes out all of my HTML
I have used vanilla Blueprint with Rails and it work very well. But when
I have a JavaScript snippet that runs very well on Firefox and Safari, 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.