I\'m trying to disable submit button if the user hasn\'t provided any text.
At first sight it looks that everything works just fine, but if user types some text, th
For those that use coffeescript, I've put the code we use globally to disable the submit buttons on our most widely used form. An adaption of Adil's answer above.
$('#new_post button').prop 'disabled', true
$('#new_post #post_message').keyup ->
$('#new_post button').prop 'disabled', if @value == '' then true else false
return