JavaScript forms and functions
<p>I am trying to write a simple random number generator, where you input 3 integers into forms. The program then returns a certain amount of random numbers between the other two values. When I open the page the forms are displayed but when I click the button to generate the random numbers nothing happens. Why is this happening?</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script LANGUAGE="JavaScript"&gt;


    function randomFromTo(from, to)
    {
        return Math.floor(Math.random() * ((to - from) + 1) + from);
    }
function include(arr, obj)
{
    for(var j = 0; j &lt; arr.length; j++)
    {
    if (arr[j] == obj) return true;
    }
}
    function RandomGen(form)
    {
    var enteries = new Array();
    var number = form.from.value;
    var top = form.top.value;
    var size = form.inputBox.value;
    var count;
    for (count = 0; count &lt; size; count++)
    {
        var num = randomFromTo(number, top);
        if (include(enteries, num) == true)
        {
            count--;
        }
        else
        {
            enteries[count] = num;
        }
    }
    var i;
    for(i = 0; i &lt;= enteries.length; i++)
    {
        document.write(enteries[i]);
        document.write("&lt;br&gt;");
    }
}


&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;center&gt;&lt;h1&gt;Random Number Generator&lt;/h1&gt;&lt;/center&gt;
&lt;form name="myform" action="" method="GET"&gt;Enter the Range of Values
&lt;input type="text" name = "from" value=""&gt;to
&lt;input type="text" name = "top" value=""&gt;
&lt;p&gt;Enter The Amount of Random Numbers Needed
&lt;input type="text" name = "inputBox" value=""&gt;&lt;p&gt;
&lt;input type="button" name="button" value="Generate" onClick=RandomGen(this.form)"&gt;
&lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p></p>
