Domanda

I have a HTML form which, when submitted, loads a results page.

When I link to the same results page with an anchor tag I can use either rel="external" or data-ajax="false" which forces a full refresh of the page and reloads the relevant page CSS.

Is there an equivalent for pages loaded from form a submission? I am not currently using jQuery to submit the form.

NOTE:

Further to @peterm's answer, which I tried initially without success, I had a parameter appended to the form's action string (action="results.php?type=search") which I moved into a hidden input element inside the form:

<input type="hidden" name="type" value="search" />

After doing this it worked perfectly for me.

È stato utile?

Soluzione

You can use data-ajax="false" on a form element.

According to jQuery Mobile Docs

To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the data-ajax="false" attribute. The target attribute (as in target="_blank") is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the rel attribute is not allowed on forms.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top