DrupalDork.com was shut down on September 18, 2013. This is just a snapshot of the site as it appeared then.
Drupal 7
Submitted by Brock on Tue 29 Jan 2013, 1:49 pm
Related to my fieldset summary problem: autocomplete fields do not trigger the change
event in Javascript, for some reason. I wound up stealing part of a patch I found somewhere (I would link to it if I could find it in my browser history) in order to override the autocomplete prototype function and trigger a new autocompleteSelect
event when the user chooses an item in an autocomplete field. Just drop this function into a Javascript file in your module or theme:
Submitted by Brock on Tue 29 Jan 2013, 1:45 pm
Please excuse the long title: it took me a while to figure this one out, so I want to make sure that other people can find this when they need it.
On my current project, I'm changing the node author field based on the value of a user reference field on the node type: when a content admin sets the node reference field, the node author field is changed to match that user reference field value. Since the author field is shown in a fieldset, I wanted the summary on that fieldset to update when this change was made. It took me a while to figure out how, but it's pretty simple:
// Update the field summary if vertical tabs are in use
var tab = $('fieldset.node-form-author', context).data('verticalTab');
if (tab) {
tab.updateSummary();
}