helloeveryone
helloeveryone

Reputation: 39

phonegap auto back previous page

I am using phonegap to write an application. I use jquery framework to combine different pages into one page. The problem occurs when I open the application and fill in the form, next page is shown.But it returns back to Index page quickly. Then I fill in the form again. The problem does not occur again. How can I fix the problem of returning back?

<input type="submit" onclick="location.href = '#page1'" value="Submit" />

Upvotes: 0

Views: 277

Answers (1)

Davor Zlotrg
Davor Zlotrg

Reputation: 6060

You should use $.mobile.changePage('#page1'); from the jquery mobile framework

As stated in the documentation:

Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled.

http://jquerymobile.com/demos/1.2.1/docs/api/methods.html

Upvotes: 1

Related Questions