Commit 2cb7bf71 authored by Robert Schilling's avatar Robert Schilling

Rtrim input before checking if form is empty

parent 2600d08f
......@@ -58,10 +58,10 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
field = $(field_selector)
closest_submit = field.closest("form").find(button_selector)
closest_submit.disable() if field.val() is ""
closest_submit.disable() if field.val().replace(/\s+$/, "") is ""
field.on "input", ->
if $(@).val() is ""
if $(@).val().replace(/\s+$/, "") is ""
closest_submit.disable()
else
closest_submit.enable()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment