Forum: Ruby on Rails Disabling textfields while submitting ajax call

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ebac0be1687975b63a20da7b254442ab?d=identicon&s=25 Sebastian probst Eide (sebastianpe)
on 2007-05-20 19:12
(Received via mailing list)
Hi
I have a form_remote_tag-form that submits the contents of a text-
field to the server. I have added javascript calls that show a spinner
and hide the submit button while the server is processing the request,
and would like to disable the textfield too.

I managed to disable the textfield using the prototype call $
('text_field_id').disabled = true; but when I do that the content of
the text field doesn't get sent to the server! Is there a way to
disable the text-field and still get the content sent to the server?

Best regards
Sebastian
6e9db38e16957cc51cf9cee9de399249?d=identicon&s=25 dasil003 (Guest)
on 2007-05-20 19:49
(Received via mailing list)
Without looking up any documentation, isn't there a hook in the
prototype function that is called immediately after submitting the
form that you can use to disable the field after the contents are
sent?

On May 20, 11:12 am, Sebastian Probst Eide
Ebac0be1687975b63a20da7b254442ab?d=identicon&s=25 Sebastian probst Eide (sebastianpe)
on 2007-05-21 00:21
(Received via mailing list)
The callbacks as listed are:

:loading:  Called when the remote document is being loaded with data by
the browser.
:loaded:  Called when the browser has finished loading the remote
document.
:interactive:  Called when the user can interact with the remote
document, even though it has not finished loading.
:success:  Called when the XMLHttpRequest is completed, and the HTTP
status code is in the 2XX range.
:failure:  Called when the XMLHttpRequest is completed, and the HTTP
status code is not in the 2XX range.
:complete:  Called when the XMLHttpRequest is complete (fires after
success/failure if they are present).

Using :loading is working!
Thanks for the help.

S
This topic is locked and can not be replied to.