Hello,

It would be we great if we have this feature:
Possibility to choose - under exposed filter style - if we want the blur event to trigger the auto-submit when using ajax with auto-submit on

I'm asking for this feature because I have this bug (jquery):
* How to reproduce:
- Have exposed filters with ajax and autosumbit on
- Put the exposed filters form on a block
- type something on any of the exposed filters input fields and wait drupal will present the filtered data
- don't click anywhere (window, scrollbars, browser buttons)
- click a link
- You get a browser message:

An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /views/ajax
StatusText: error
ResponseText:
ReadyState: 0

This message will flash in Firefox (I'm using FF 4) but it stays on Google Chrome until you press the OK button.

Regards,
Nabil KADIMI

Files: 
CommentFileSizeAuthor
#5 chrome-filter-error.png55.84 KBgeerlingguy

Comments

kadimi’s picture

Title:Ability to disable autosubmit on blur even because it causes an ugly ajax error message » Requesting the ability to disable autosubmit on blur event which causes an ugly ajax error message
dawehner’s picture

Project:Views» Chaos tool suite (ctools)
Version:7.x-3.x-dev» 7.x-1.x-dev
Component:exposed filters» Code
Priority:Critical» Normal

There aren't critical feature request by definition, because critical means that there is something broken.

* How to reproduce:
- Have exposed filters with ajax and autosumbit on
- Put the exposed filters form on a block
- type something on any of the exposed filters input fields and wait drupal will present the filtered data
- don't click anywhere (window, scrollbars, browser buttons)
- click a link
- You get a browser message:

In general autosubmit is part of ctools.

It would be we great if you (merlinofchaos) added this feature:

Kind of sad, i would have created a patch perhaps.

kadimi’s picture

Thank you dereine, this is valuable information to me.

Oh, my social abilities suck, it would be great if you made a patch for this.

Thanks for your help.

kadimi’s picture

I found a workaround - replace the js alert() function if not needed:

window.alert = function() {};

or even better

window.alert = function ( text ) { console.log( 'tried to alert: ' + text ); return true; };
alert( new Date() );
// tried to alert: Wed Dec 08 2010 14:58:28 GMT+0100 (W. Europe Standard Time)

http://stackoverflow.com/questions/4388248/disable-alert

geerlingguy’s picture

Title:Requesting the ability to disable autosubmit on blur event which causes an ugly ajax error message» AJAX autosubmit with exposed filters causes error when user hits return
Project:Chaos tool suite (ctools)» Views
Version:7.x-1.x-dev» 7.x-3.x-dev
Component:Code» exposed filters
Category:feature» bug
StatusFileSize
new55.84 KB

Subscribe... I'm also getting an error if I simply enter some text in a textbox exposed filter, then press 'enter' before the autosubmit magic happens.

To reproduce:

  1. Create a page view with an exposed filter like Content: Title
  2. Set the exposed filters to appear in a block.
  3. Set the view to use AJAX.
  4. Set the filters to autosubmit using AJAX.
  5. Go to the views-created page, enter some text, and hit enter immediately.

A warning like the following will pop up (at least, in Chrome), and the textfield's focus will go away (requiring the user to click back in the textfield to enter or change any information), plus the textfield's contents will be lost...:

I've had this happen on three separate websites in two different server environments, so I'm fairly certain something in the JS is causing this issue... just don't have the JS chops to figure it out.

The title of this issue is deceiving, but it seems that the problem is similar to/the same as mine.

I'm setting the category back to bug report, because this problem actually causes data loss - the user enters a search term, and after he hits return/enter, that entered data is gone. It can be quite frustrating to get a user to realize he is able to simply enter text and not hit the return key...

The exact error:

The page at www.example.com says:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /views/ajax
StatusText:
ResponseText:
ReadyState: 4
geerlingguy’s picture

Using something like the following JavaScript has fixed this problem on my views exposed forms:

(function ($) {
  $(document).ready(function() {
    $(".form-text").keydown(function(event) {
      if (event.keyCode == 13) {
        event.preventDefault();
        return false;
      }
    });
  });
})(jQuery);

[Edit: Updated code - select only text fields using .form-text selector instead of window selector.]
Obviously, we wouldn't want to take away return key functionality for an entire page, but if we could adapt this to remove return key functionality for AJAX-enabled textfields in exposed filters, I think this would nicely solve the problem I've encountered.

Note, however, that once a user clicks a link to go off the current page, the error message still pops up. Is there any way we could squelch that error message?

geerlingguy’s picture

Status:Active» Closed (duplicate)

Closing and marking a duplicate of #1232416: Drupal alerts "An AJAX HTTP request terminated abnormally" during normal site operation, confusing site visitors/editors. I've posted a patch in #1232416-16: Drupal alerts "An AJAX HTTP request terminated abnormally" during normal site operation, confusing site visitors/editors that fixes this issue entirely, without any hackish behavior. If we can get that issue fixed, I think it will solve this issue and many others I've seen posted around drupal.org (issue queues and in forums).

geerlingguy’s picture

Issue summary:View changes

see dereine comment