Drupal 7 behaviors don't work

1.1k views Asked by At

I'm having a problem where Drupal behaviors seem to work with logged in users, but not everyone else, except when the behavior is executing a submit().

For example this won't work.

Drupal.behaviors.login_activate = {
  attach: function (context, settings) {
    $("#sr_login", context).hover(
      function(){
        $(this).append($("<span> ***</span>"));
      },
      function(){
        $(this).find("span:last").remove();
      }
    );
  }
};

This does work.

Drupal.behaviors.foundation_donation = {
  attach: function (context, settings) {
    $('#monthly_submit').click(function(){
      $('#monthly_donation').submit();
    });
    $('#single_submit').click(function(){
      $('#single_donation').submit();
    });
  }
};
0

There are 0 answers