提交 2cb7bf71 编写于 作者: R Robert Schilling

Rtrim input before checking if form is empty

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册