Sorry, I'm a newbie in js yet, but are you sure there's no way to get the return value in `trigger`?

The `onclick` event do this way if I remember correctly, when you return false to the event, it cancels whatever else it will do. Actually, it's the way I have solved my problem with the `link_to_add_association`, I just created an `onclick` event for the association link and returned `false` when the add must not be executed.