Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the module folder open fapi_multiselect.js and in the click functions starting on line 84 change them to the following:
$wrapper.find('ul li a:eq(0)').click(function(event) {
event.preventDefault();
$leftSelect.moveSelectionTo($rightSelect);
updateMainSelect();
});
// Moves selection if remove is clicked to selected box
$wrapper.find('ul li a:eq(1)').click(function(event) {
event.preventDefault();
$rightSelect.moveSelectionTo($leftSelect);
updateMainSelect();
});
This will prevent the default action on the click on the "a" tag.
Thanks
James
Comments
Comment #1
szadok CreditAttribution: szadok commented+1
Like the suggestion
Comment #2
ryan.merritt CreditAttribution: ryan.merritt commentedExcellent suggestion, took a minute of looking at it to understand as well, thank you :)
Comment #3
thehong CreditAttribution: thehong commentedCommited. Thanks.
Comment #4
thehong CreditAttribution: thehong commentedComment #6
WorldFallz CreditAttribution: WorldFallz commentedfyi this commit caused an error. The commit left out 'event' from
.click(function(event))
both calls. Patch attached in #1863284: js error: event is not defined.Comment #6.0
WorldFallz CreditAttribution: WorldFallz commentedadded code tags