jQuery Chosen plugin add options dynamically with out using Ajax?
<p>first of all this is not a duplicate question. i checked all the available questions i didn't find the solution.</p>

<p>My Problem is, i am working in a project which is using <code>Jquery choosen</code> plug-in <code>version 1.5.1</code> to create multiple select form fields. in some <code>multi select fields</code> i need to add options dynamically if the option not available in the list. for example<br></p>

<p>i have a <code>tags</code> field with 3 options<br>
1. male<br>
2.female<br>
3.kids but i am allowing user can able to add any new tag like <code>young</code> <code>baby</code> for this field. to achieve this  i did like this in following tutorial
<a href="https://boundlessjourney.wordpress.com/2014/06/12/adding-new-values-to-chosen-plugin/" rel="nofollow">add attributes dynamically in using chosen plugin</a>. </p>

<p>this is working fine. but the problem is this is adding new values in all <code>multi-select</code> fields. some fields like <code>products</code> should not allow to add. i have a very less fields to add dynamic values. so want to impliment that <code>case 13</code> logic in the form itself to add tags. till now i tried like this</p>

<pre><code>$('#product_tags').on( "keypress", function (e) {

  if (e.which == 13) {
    e.preventDefault();
    $('#product_tags').empty();
    $('#product_tags').append('&lt;option&gt;' + $(evt.target).val() + '&lt;/option&gt;');
    $('#product_tags').trigger("chosen:updated");
  }
});
</code></pre>

<p>its not working. how can i achieve this?? any help would be well appreciate.. thank you</p>