Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Generate Random Number

$
0
0

Replies: 0

I’m using the following javascript to generate a random number from a form. This is then used as a unique ID number field. Problem is it seems to fail about 10% of the time. Not sure if its failing from specific devices or browser settings. Is there a better or more reliable way of generating a number?

<input id="ID" name="Application_ID">
   <script type="text/javascript">
   document.getElementById("ID").value = Math.random();
   </script>

Viewing all articles
Browse latest Browse all 59525

Trending Articles