title: Pasting multiple numbers over multiple input fields
body: <p>I've got a form on my site using 6 input fields.  The site visitor simply enters a 6 digit code into these 6 boxes.  The thing is that they'll get the 6 digit code and it would be ideal to allow them to simply copy the 6 digit code we send them into these input fields by simply putting pasting into the first input field and having the remaining 5 digits go into the remaining 5 input fields.  It would just make it much easier than having to manually enter each digit into each input field.</p>
  
  <p>Here's the code we're currently using, but it can easily be changed to accomplish what is described above:</p>
  
  <pre><code>&lt;input type="text" maxlength="1" class="def-txt-input" name="chars[1]"&gt;
  &lt;input type="text" maxlength="1" class="def-txt-input" name="chars[2]"&gt;
  &lt;input type="text" maxlength="1" class="def-txt-input" name="chars[3]"&gt;
  &lt;input type="text" maxlength="1" class="def-txt-input" name="chars[4]"&gt;
  &lt;input type="text" maxlength="1" class="def-txt-input" name="chars[5]"&gt;
  &lt;input type="text" maxlength="1" class="def-txt-input" name="chars[6]"&gt;
  </code></pre>
  
  <p>I saw a posting similar to this here: <a href="https://stackoverflow.com/questions/8028862/pasting-of-serialnumber-over-multiple-textfields">Pasting of serialnumber over multiple textfields</a></p>
  
  <p>But it doesn't have the solution I'm looking for.  Ideally this could be pulled off using jQuery or plain JavaScript.</p>