limit selection of custom taxonomies to one?

Instead of hacking it with jQuery, a more reliable solution would be to replace the meta box with your own, in PHP.

Anyway, the problem is most likely with the ‘[‘ and ‘]’ characters in the selector:

"input[name=tax_input[ba_locations][]]"

could be rewritten as

"input[name=tax_input\\[ba_locations\\]\\[\\]]"

See https://stackoverflow.com/questions/2786538/need-to-escape-a-special-character-in-a-jquery-selector-string

Leave a Comment