/** * Disable disallowed terms in taxonomy fields, and re-enable on submit. * * We do this in jQuery because FAPI does not yet support it: * @see * http://drupal.org/node/284917 * @see * http://drupal.org/node/342316 * * @todo * Use clearer coding standards. * @see * http://jsdemystified.drupalgardens.com/ */ Drupal.behaviors.tac_create = {}; Drupal.behaviors.tac_create.attach = function(context, settings) { var $ = jQuery; var $fields = $(Drupal.settings.taxonomy_access); // For each controlled field, disable disallowed terms. $.each($fields, function(i, field) { var fieldname = "." + field.field; // Disable disallowed term and its label, if any. $.each(field.disallowed_tids, function(j, tid) { // Children of the widget element with the specified tid as a value. // Can be either