clarity icon indicating copy to clipboard operation
clarity copied to clipboard

form submits to blank page on enter

Open smith opened this issue 14 years ago • 1 comments

If I submit the search form by pressing enter instead of clicking the button I am sent to a blank page.

To fix this, you could do

 $("#" + search_form).bind("submit", function (event) {
     event.preventDefault();
     Search.submit();
 });

Or something like that instead of putting the onclick handler inline on the button.

smith avatar Dec 04 '09 14:12 smith

Ok, well apparently this doesn't happen always, so my fix above might not quite work. It may have happened before the DOM was ready, so maybe the submit needs to be disabled until it's ready.

smith avatar Dec 04 '09 14:12 smith