Generate random password string with requirements in javascript
<p>I want to generate a random string that has to have 5 letters from a-z and 3 numbers. </p>

<p>How can I do this with javascript?</p>

<p>I've got the following script, but it doesn't meet my requirements.</p>

<pre><code>        var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
        var string_length = 8;
        var randomstring = '';
        for (var i=0; i&lt;string_length; i++) {
            var rnum = Math.floor(Math.random() * chars.length);
            randomstring += chars.substring(rnum,rnum+1);
        }
</code></pre>
