first of all this is not a duplicate question. i checked all the available questions i didn't find the solution.
My Problem is, i am working in a project which is using
plug-in
to create multiple select form fields. in some
i need to add options dynamically if the option not available in the list. for example<br>
i have a
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
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>.
this is working fine. but the problem is this is adding new values in all
fields. some fields like
should not allow to add. i have a very less fields to add dynamic values. so want to impliment that
logic in the form itself to add tags. till now i tried like this
its not working. how can i achieve this?? any help would be well appreciate.. thank you
My Problem is, i am working in a project which is using
Code:
Jquery choosen
Code:
version 1.5.1
Code:
multi select fields
i have a
Code:
tags
1. male<br>
2.female<br>
3.kids but i am allowing user can able to add any new tag like
Code:
young
Code:
baby
<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>.
this is working fine. but the problem is this is adding new values in all
Code:
multi-select
Code:
products
Code:
case 13
Code:
$('#product_tags').on( "keypress", function (e) {
if (e.which == 13) {
e.preventDefault();
$('#product_tags').empty();
$('#product_tags').append('<option>' + $(evt.target).val() + '</option>');
$('#product_tags').trigger("chosen:updated");
}
});
its not working. how can i achieve this?? any help would be well appreciate.. thank you