Here's the whole page actually. This text box is the one that it generates to, but I'd rather it generate to a parent box.
Code:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<body>
<script>
$(function() {
$('#genID').click(function() {
var SystemID = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for (var i = 0; i < 8; i++)
SystemID += possible.charAt(Math.floor(Math.random() * possible.length));
$('input[name="ID"]').val(SystemID);
});
});
</script>
<input name="ID" type="text" id="id" onClick="this.select();" readonly="readonly">
<button id="genID">Generate System ID</button>
</body>
</html>
Bookmarks