Menu
Hi,
I would like to generate a random number and then display that number as the initial value in a form input field.
Example:
<SCRIPT LANGUAGE=”JavaScript”>
var rand_no = Math.random();
rand_no = rand_no * 100;
rand_no = Math.ceil(rand_no);
</SCRIPT>
Now generate the field with the value of the random number:
<p>
<input readonly type=”text” name=”ranNum” value=”<%=rand_no%>”>
</p>
This does not work. Can anyone suggest what has to be done to get it to work.
Alternatively is it possible to just write the value using something like:
<p>
“<%=rand_no%>”
</p>
Many thanks