title: Javascript trigger on "KeyPress" and "Paste"
body: <p>I have a JavaScript that checks if a field equals to 15 characters, and if not the submit button is greyed out. This works perfetcly if i type in 15 characters manually, but not if i paste 15 characters. How can i make it check even when content is pasted in the field?</p>
  
  <p>Can i make it check for characters periodicly (seconds) or is there a function for "check on paste"?</p>
  
  <p>My script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function($){
  $('input[type=submit]').attr("disabled","disabled");
  $('input[name="item_meta[1234]"]').keypress(function() { //change # to the ID of your field
          if (document.getElementById("field_ygtw9u").value.length &lt; 14) { //disable submit if "no" is selected
                $('input[type=submit]').attr("disabled","disabled");
          } else { //enable the submit button
                $('input[type=submit]').removeAttr('disabled');
          }
    });
  });
  &lt;/script&gt;
  
  &lt;form&gt;
  &lt;div id="frm_field_1234_container" class="frm_form_field form-field  frm_required_field frm_top_container"&gt;
  &lt;label class="frm_primary_label"&gt;Minimun 15 char:
      &lt;span class="frm_required"&gt;&lt;/span&gt;
  &lt;/label&gt;
  &lt;input type="text" id="field_ygtw9u" name="item_meta[1234]" value=""  maxlength="15" class="required"/&gt;
  
  &lt;p class="submit"&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>