jkkenzie Posted January 26, 2010 Share Posted January 26, 2010 I need javascript to generate value like below and the the ability to place it on a forms input value like below php code. <?php $mynumber= rand(673,62389); echo $mynumber; ?> <input type="text" value="<?=$mynumber?>"> Thanks Link to comment https://forums.phpfreaks.com/topic/189822-generate-random-security-code/ Share on other sites More sharing options...
salathe Posted January 26, 2010 Share Posted January 26, 2010 Look into using Math.random (and basic arithmetic operators as well as likely Math.floor) for generating a random number and the DOM for changing attributes (particularly the setAttribute method on DOM Elements). Hopefully that's enough keywords to search on. Link to comment https://forums.phpfreaks.com/topic/189822-generate-random-security-code/#findComment-1001747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.