title: Using JavaScript, how to generate a randm 11 char string following these param/rules? (L,L,L,L/N,L/N,N,N,N,N,N,N)
body: <p>I am trying to figure out, using Javascript, how to generate a RANDOM 11 character string which requires a specific sequence of letters/numbers, in regards to position.<br><br></p>
  
  <p>-----------------------------------------------------------------------<br>
  <i>Example of what I need to be able to generate:</i><br><br></p>
  
  <p><b>Key:</b><br>
  <b>C</b> - Constant <i>(regardless of whether Alpha or Numeric Char; is NEVER randomized)</i><br>
  <b>L</b> - Alpha Character<br>
  <b>N</b> - Numeric Character<br>
  <b>L/N</b> - Either Letter or Number acceptable<br><br></p>
  
  <p>|#1.|#2.|#3.|#4.|#5.|#6.|#7.|#8.|#9.|#10|#11| <br>
  |C..|C..|C..|L/N|L/N|N..|N...|N..|N...|N...|N...|<br><br></p>
  
  <p><i>generated string example:</i><br>
  ABC1A123456<br>
  ABCAB859328<br>
  ABC41932013<br>
  ABCD2615982<br>
  ABCEF081799<br>
  ABC32701174<br>
  <i>etc...</i><br>
  -----------------------------------------------------------------------<br><br></p>
  
  <p>This is what I've started with.. I have my first 3 characters (the constants) and I have the alphanumeric characters that i want eligible for the randomization of the remaining 8 char of the sequence. But what I don't have, and what I'm asking the community to help me with, is how to implement rules so that my script will only allow the randomized generated strings to follow the description I've given above.  </p>
  
  <p>I hope I've explained everything clearly. =\</p>
  
  <pre><code>function makeid() {
    var text = "LJH";
    var possible = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    for (var i = 0; i &lt; 8; i++)
      text += possible.charAt(Math.floor(Math.random() * possible.length));
  
    return text;
  }
  
  
  function main() {
      document.getElementById("number").value = makeid();
      document.getElementById("button").click();
  }
  
  setInterval(function() {
      main();
  }, speed);
  </code></pre>