oops - the script lets strings < 10 chars pass...here's a new version:
[tt]
function getRndStr() {
var chars = "abcdefghijklmnopqrstuvwxyz0123456789";
var sRes = "";
for (x = 0; x < 10; x++) {
// get next char
nextChar = chars.charAt(Math.round(Math.random() * (chars.length - 1)));
// randomly make uppercase
if (Math.round(Math.random()) == 1) nextChar = nextChar.toUpperCase();
sRes += nextChar;
}
if (sRes.length != 10) getRndStr();
else return sRes;
}
[/tt]
=========================================================
if (!succeed) try();
-jeff
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.