Skip to content
This repository

Forms Don't Recognize rel="external" or target Attributes #952

Closed
bdoms opened this Issue · 4 comments

4 participants

Brendan Doms Scott Jehl Pavel Kácha Todd Parker
Brendan Doms

Since anchor tags can be forced to reload the entire page instead of using AJAX by adding rel="external" or a target, it follows that form tags should have the same behavior.

At the very least, there should be some way of indicating that a form should not use AJAX.

Pavel Kácha

This behaviour is really annoying.

Is available some workaround for the present?

Brendan Doms

As I mentioned in a different, but related bug (https://github.com/jquery/jquery-mobile/issues#issue/570), if the form uses GET there is a workaround by just forcing the window's URL to be what you want on submit:

$("#formid").submit(function() {
    window.location = this.action + "?" + $(this).serialize();
}

However, I'm not sure if you can workaround this for forms that use POST.

Todd Parker

THanks, I just bumped this up to critical.

Scott Jehl scottjehl closed this
Scott Jehl

Added support for the target attribute on forms (such as target="_blank"). When set, the form handler simply allows the native handling to apply. Unlike anchors however, the rel attribute is not allowed on forms. If you're purely looking to submit a single form without ajax, you can use the data-ajax="false" attribute as well. Closed by 6100594 and docs updates are included

Brandon Woo brandonwoo referenced this issue from a commit
Added support for the target attribute on forms (such as target="_bla…
…nk"). When set, the form handler simply allows the native handling to apply. Unlike anchors however, the rel attribute is not allowed on forms. If you're purely looking to submit a single form without ajax, you can use the data-ajax="false" attribute as well. Fixes #952 and docs updates are included
6100594
Timmy Willison timmywil referenced this issue from a commit
Added support for the target attribute on forms (such as target="_bla…
…nk"). When set, the form handler simply allows the native handling to apply. Unlike anchors however, the rel attribute is not allowed on forms. If you're purely looking to submit a single form without ajax, you can use the data-ajax="false" attribute as well. Fixes #952 and docs updates are included
3d867b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.