i’m trying to disable a input while i’m submiting it in a remote form.
My coffee code is like this:
todoSubmitForm = $('form.todo-form')
todoSubmitForm.on 'ajax:before', ->
input = $(this).find('input#todo')
return false if not input.val() and not input.val().match /^\s+$/
input.attr 'disabled', 'disabled'
todoSubmitForm.on 'ajax:complete', ->
$(this).find('input#todo').removeAttr 'disabled'
turbolinksRefresh()
But, the input that I disable was not submited that way.
I don’t know if it’s a bug or if I’m doing something wrong…
Fields from disabled input elements are not submitted as part of the form.
You can set it to
readonly: