<script>var keylist1="abcdefghijklmnopqrstuvwxyz123456789*@#$%-",
keylist2="ABCDEFGHIJKLMNOPQRSTUVWXYZ",
temp='';
function generatepass(plength){
temp='';
for(i=0;i<plength;i++){
temp+=keylist1.charAt(Math.floor(Math.random()*keylist1.length));
}
for(i=0;i<plength;i++){
temp+=keylist2.charAt(Math.floor(Math.random()*keylist2.length));
}
return temp;
}
function populateform(enterlength){
document.pgenerate.output.value=generatepass(enterlength);
}
</script>
<form name="pgenerate">
<input type="text" size="25" name="output" maxlength="20">
<input type="button" value="generatepassword" onClick="populateform(this.form.thelength.value);"><br>
<b>Password Length:</b>
<input type="text" name="thelength" size="3" value="8" maxlength="2">
</form>