If the user press the »enter« key after writing something in the Uberimage reference field which can't be translated to a node (e.g. "asdfasdfasfd") the whole form is submitted and you'll get a browser error message saying "An HTTP error occured. /aef_image/ahah/page/field_uberimage/0". The same error message occurs if you first reference a node, then remove all text and press enter.

Sending the form on enter is normal browser behaviour which can't be changed. However, a server side check so that the error message doesn't show (well not in that way but perhaps in the

Found no valid post with that title

) might be a good thing. Since JQuery is a dependency, maybe e.preventDefault(); is one part of the solution, client side.

Comments

ndeschildre’s picture

Hello,

Weird. Works fine here.
If you have firebug, can you show me the result of the AJAX call when you get this HTTP error (you can ususally see the PHP error in the response tab of the AJAX call there)?

Thanks

EmilOberg’s picture

Problem only occur if I let the blue spinning wheel within the reference field complete (in other words: if you let the AJAX GET complete and send you a response) and then press enter.

I do run Firebug but it won't play nicely. Since the form is submitted when I press enter Firebug is wiped clean and I only get a split second to see the AJAX response. I tried using the Firebug Net Panel History Overlay extenssion but it don't integrate well with my version of Firebug. Do you have any ideas as for how I can get the AJAX result?

ndeschildre’s picture

Ookay finally able to reproduce.

That's another Drupal related bug, if you submit a form while an AHAH call is pending, it returns you this error. I do unfortunately not have a bugfix for that.

EmilOberg’s picture

Rats!