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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:45:40+00:00 2026-06-09T00:45:40+00:00

Hey guys not done java in ages and found I lost most of what

  • 0

Hey guys not done java in ages and found I lost most of what I learned.

Trying to check that Personal Best has been sellected and the Value is within 1 to 1000

Been pulling my hair out and hoping you guys can tell me where I am going wrong so I can then code the other values myself.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<style type="text/css">
.auto-style1 {
    width: 84%;
    height: 156px;
}
.auto-style3 {
    width: 286px;
}
.auto-style4 {
    width: 151px;
}
.auto-style5 {
    width: 123px;
}
</style>
<script type='text/javascript'>
function valueNumeric(){
var valueResult
var valuetaId=document.forms["myForm"]["Value"].value;
    var numericExpression = /^[0-9]+$/;
    if(valuetaId.match(numericExpression))
        {
        valuetaId = parseFloat(valuetaId)
        if((valuetaId >= 1 ) ||(valuetaId <= 1000 ))
            {
            valueResult = ("Valid");
            document.getElementById("vl").innerHTML=valueResult;            }
        else
            {
            valueResult = ("Please enter calue between 1 and 1000");
            document.getElementById("vl").innerHTML=valueResult;
            }
    }else{
        valueResult = ("Please enter calue between 1 and 1000");
        document.getElementById("vl").innerHTML=valueResult;
    }
}
function personalbest(selection)
{
var rundataResult;
var rundataId=document.forms["myForm"]["personalbest"].value;
    if(rundataId == "Please Choose")
    {
    rundataResult = ("Please choose a value.");
    document.getElementById("pb").innerHTML=rundataResult;
    }
else{
    rundataResult = ("valid");
    document.getElementById("pb").innerHTML=rundataResult;
    }
}
</script>
</head>

<body>

<form name="myForm" action="" method="post">
    <br />
    <table class="auto-style1">
        <tr>
            <td class="auto-style4">Value 1 to 1000</td>
            <td class="auto-style5"><input name="Value" type="text" onblur="valueNumeric" /></td>
            <td class="auto-style3">
            <p id="vl">Please enter calue between 1 and 1000</p>
            </td>
        </tr>
        <tr>
            <td class="auto-style4">Date YY-MM-DD</td>
            <td class="auto-style5"><input name="Date" type="text" /></td>
            <td class="auto-style3">
            <p>Please enter a date.</p>
            </td>
        </tr>
        <tr>
            <td class="auto-style4">Time HH-MM-SS</td>
            <td class="auto-style5"><input name="Timme" type="text" /></td>
            <td class="auto-style3">
            <p>Please enter your time.</p>
            </td>
        </tr>
        <tr>
            <td class="auto-style4">Grade % i.e. 74.56</td>
            <td class="auto-style5"><input name="Grade" type="text" /></td>
            <td class="auto-style3">
            <p style="width: 394px">Pease enter your grade as a % with 2 decimal 
            places</p>
            </td>
        </tr>
        <tr>
            <td class="auto-style4">Personal Best</td>
            <td class="auto-style5"><select name="personalbest" onchange="personalbest('selection')">
            <option selected="selected">Please Choose</option>
            <option value="1">Yes</option>
            <option value="0">No</option>
            </select></td>
            <td class="auto-style3">
            <p id="pb">Please choose a value.</p>
            </td>
        </tr>
    </table>
</form>

</body>

</html>
  • 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-09T00:45:42+00:00Added an answer on June 9, 2026 at 12:45 am

    You didn’t call valueNumeric use onblur="valueNumeric()" to call it notice the ()

    Also if((valuetaId >= 1 ) ||(valuetaId <= 1000 )) will evaluate true for any value, use if((valuetaId >= 1 ) && (valuetaId <= 1000 )) for range between 1 and 1000

    Also there is a conflict with personalbest the element name and the function so change the function name to personalBest

    FIDDLE

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

Sidebar

Related Questions

Hey guys I have a query that selects data and organizes but not in
Hey guys, I have a search field that is not submitting when the enter
hey guys, i'm facing a little annoying bug that's in my case not really
hey guys, i know it's not the best way of doing this but the
Hey guys, I have a little button functionality that is not erring, but also
Hey guys I'm not sure how to write this in AS3, but basically I
Hey guys i have looked as much as i could and i could not
hey guys was hoping you could help me out, Not sure if I always
Hey guys this should be simple, I'm just not seeing it, I would like
Hey guys I was not really sure how to word the title to make

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.