Gravatar for

Question by swiftus, Mar 31, 2015 11:33 AM

Odd behavior with JS QueryBox and IE

When using the JavaScript QueryBox component and IE (11), when press 'Enter' in the box, the search page refreshes clearing out what I just typed in as a search string. I can use the SearchButton component or enable SearchAsYouType and it's fine. Just when pressing enter and just in IE browsers (9 and 11). Works fine in Chrome. Any suggestions?

1 Reply
Gravatar for

Answer by swiftus, Mar 31, 2015 11:43 AM

It was IE's handling of the

tag - nothing to do with the Coveo JS.

Gravatar for

Comment by Simon, Mar 31, 2015 2:21 PM

Good point, but this is not only in IE, this is a standard behavior of the tag in HTML. Using Javascript you can cancel this event using return false at the end of the form submit event. Or use jQuery event.preventDefault();

Ask a question