Are form_remote_tag and submit_to_remote mutually exclusive?

Do I need to use submit_to_remote in conjunction with or instead of
form_remote_tag? The description in the API docs. is confusing.

Is the combination of form_tag/submit_to_remote valid?

Is the combination of from_remote_tag/submit_tag valid?

Thanks,
Wes

Wes G. wrote:

Do I need to use submit_to_remote in conjunction with or instead of
form_remote_tag? The description in the API docs. is confusing.

Is the combination of form_tag/submit_to_remote valid?

Is the combination of from_remote_tag/submit_tag valid?

Thanks,
Wes

The regular submit tag works fine with form_remote_tag. I think the
submit_to_remote tag is there so that you can do ajax for one button in
a regular form. You could use it for some help with the form, like
explaining the minimum acceptable password conditions in a signup form,
or explaining the three digit code thing on the back of a credit card,
by sliding in some help text or something - while making the main form
submit a non-ajax regular old form.

I’m a newbie, so this is just a guess. I’ve definitely had good results
with submit_tag together with form_remote_tag. Haven’t had a reason to
use the submit_to_remote yet.

best,
jp

Wes G. wrote:

Do I need to use submit_to_remote in conjunction with or instead of
form_remote_tag? The description in the API docs. is confusing.

Is the combination of form_tag/submit_to_remote valid?

Is the combination of from_remote_tag/submit_tag valid?

submit_to_remote writes the submit tag HTML in such a way that it
doesn’t submit the form, it just kicks off whichever Ajax stuff you
give it. form_remote_tag writes the form tag in the same way.

so if you’re doing a submit_to_remote, it won’t matter at all what’s
in the form tag, since the form tag’s stuff will never be invoked.
that means the answer to both your questions is yes. if you use
form_remote_tag with submit_tag, that’s totally valid, and form_tag
with submit_to_remote is valid too – the submit_to_remote simply
bypasses the form_tag, so it doesn’t matter what’s in there.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs