Client-side disable ability to add terms to a taxonomy that doesn't support visitors doing it.

Created on 10 July 2012, about 13 years ago
Updated 15 September 2024, 10 months ago

Hello,

So here is something that may help others, I unbind the keypress event on the target field via hook_form_alter()

    drupal_add_js("jQuery('document').ready(function() { 
      jQuery('.views-widget-filter-field_member_products_services_tid input#autocomplete-deluxe-input').unbind('keypress'); });", array('type' => 'inline'));

This causes the keypress event to never fire and stray (undefined) terms are not added to the list. You will notice that passing undefined terms to the filter in a view will throw multiple fatty errors complaining that the term doesn't exist.

Also even with the Content Taxonomy module enabled the client-side GUI doesn't validate and instead the validation occurs after submission of the form.

Maybe a validation settings could be added to the autocomplete_deluxe settings array client-side that checks if it should unbind the keypress event?

Thoughts?

✨ Feature request
Status

Closed: outdated

Version

2.0

Component

Multiple values

Created by

πŸ‡ΊπŸ‡ΈUnited States emptyvoid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024