I have a form that submits with data-remote => true.

The form has one field, a textarea. I want to prevent submission of the form if the textarea length is 0 and only allow a form submission if the length is GT 1.

How do I bind to the form in a rails 3, jquery ujs friendly way. I tried the following but that did not stop the form submissions:

 $('#new_feedback').bind('ajax:before', function() {
      e.preventDefault();
 } );

Thanks

Edit
Report