How to have a range to two input boxes where it will be divided after...
<p>I have this 2 input fields which automatically divides the first input by the second one. </p>

<p>First input field:</p>

<pre><code>&lt;input type="text" name="MyName1" id="1" value="1000.00" onkeyup="getValues(1)" size="10"&gt;
</code></pre>

<p>Second input field:</p>

<pre><code>&lt;input type="text" name="MyName2" id="2" value="26" onkeyup="getValues(2)" size="10"&gt;
</code></pre>

<p>Output:</p>

<pre><code>&lt;input type="text" id="main" name="MyOutput" size="5" value=38.46&gt;
</code></pre>

<p>And my script:</p>

<pre><code>&lt;script language="javascript"&gt;
    function getValues(val){
        var numVal1=parseFloat(document.getElementById("1").value,10);
        var numVal2=parseFloat(document.getElementById("2").value,10);
        var totalValue = numVal1 / numVal2; 
        document.getElementById("main").value = totalValue.toFixed(2);
    }
&lt;/script&gt;
</code></pre>

<p>How can I add a min/max range for both input fields so that the only range accepted on the first input field will be from 200-1000, and the second input field will be from 1-26. An alert would be also cool if the value is not within the specified range.</p>

<p>Thanks!!!</p>
