I have code where I need to get a random number when I click the submit button. The random number should be displayed in the same page in another text box. This is my code:\[code\]<html><head><script type="text/javascript">function randomnumber(num1, num2){ num1 = parseInt(num1); num2 = parseInt(num2); if(num1 >= num2) { alert("Number 2 should be greater than Number 1"); } else { var generator = Math.random()*(num2-num1); generator = Math.round(num1+generator); document.test.result.value = http://stackoverflow.com/questions/12814230/generator; document.getElementById("p1").innerHTML=generator; }}</script></head><body> <form name="test" onsubmit = "return randomnumber(num1,num2)" > <table> <tr> <td> <input type="text" name="num1" size ="35" maxlength= "25"> </td> <td> <input type="text" name="num2" size ="35" maxlength= "25"> </td> <td> <input type="text" name="p1" valuehttp://stackoverflow.com/questions/12814230/= "" size ="35" maxlength= "25"> </td> <td> <input type="submit" name="submit" value"generate"> </td> </tr> </table> </form></body></html>\[/code\]The random number is generated in the variable 'generator' in the script. I need to get the value in this textfield. \[code\]<td> <input type="text" name="p1" valuehttp://stackoverflow.com/questions/12814230/= "" size ="35" maxlength= "25"></td>\[/code\]