Home › Forums › ACF PRO › ACF taxonomy input text › Reply To: ACF taxonomy input text
Hey James,
It looks like the enter keydown event is not working on the select2.js
I made this to call the wp_insert_term() and when changing the keycode its working but when using keycode 13 its not working:
jQuery(".acf-taxonomy-field").keydown(function (e) {
var code = e.keyCode || e.which;
if(code == 13) {
var post_id = jQuery(".select2-search-field input").val();
jQuery.ajax({
type:"POST",
url: ajaxurl,
data: {
action: "formulier_ajax_request",
id: post_id
},
success:function(data) {
alert('Toegevoegd');
},
error: function(errorThrown){
alert(errorThrown);
}
});
}
});
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.