tobi / clarity

Web interface for the grep and tail -f unix tools. Useful for real-time log analysis. Remotely related to splunk
779 stars 66 forks source link

form submits to blank page on enter #6

Open smith opened 14 years ago

smith commented 14 years ago

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 commented 14 years ago

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.