Skip to content

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

Closed
bdoms opened this Issue Feb 2, 2011 · 4 comments

4 participants

@bdoms
bdoms commented Feb 2, 2011

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.

@integer
integer commented Feb 4, 2011

This behaviour is really annoying.

Is available some workaround for the present?

@bdoms
bdoms commented Feb 4, 2011

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.

@toddparker

THanks, I just bumped this up to critical.

@scottjehl

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

@scottjehl scottjehl closed this Mar 24, 2011
@brandonwoo brandonwoo pushed a commit that referenced this issue Apr 18, 2011
scottjehl 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
@timmywil timmywil pushed a commit that referenced this issue Oct 24, 2011
scottjehl 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.