javascript函数从php验证一个数字? [关闭]

how to make a javascript function to validate a number whether its in between the minimum and maximum numbers in php?

$dbosminsalary
$dbosmaxsalary
$dblastdate

<form action='workaction.php' method='post'>

<input type='number' id='amntpreferred' name='amntpreferred' class='required input_field' placeholder='Enter bid value' oninput='numberBetween();' required/> 

<script>

 function numberBetween(amntpreferred, $dbosmaxsalary, $dbosminsalary) 
 {
    if(amntpreferred <= $dbosminsalary) 
          return false;
    else if(amntpreferred >= $dbosmaxsalary)  
          return false;
    else
          return true;
 }
 if (numberBetween(amntpreferred,$dbosmaxsalary,$dbosminsalary)) 
 {
    echo 'The value is in the range!';
 } 
 else 
 {
    echo 'The value is outside the range!';
 }
</script>

have a look on this example here

<?php

$min = 1;
$max = 10;

?>

<script>
    function inRange(x) {

        if((x >= <?php echo $min; ?>) && (x <= <?php echo $max; ?>))
            return true;

        return false;
    }

    if(inRange(77))
        alert("it's ok");
    else
        alert("it's not ok");

</script>

now please have a close look on it and try to implement it on your code, the important thing is that you understand it