Closing a dialog on form submission for local storage
The app I'm currently making uses local Web SQL databases to store user input, and the forms to do so are linked to with data-rel="dialog". However, all the docs are about sending form data to a server, so I'm not sure how to handle this with jQM. I've currently got
- $('form').submit(function(){
- saveMyData();
- return false;
- });
which does a great job of saving my data and not trying to go through with an action. Unfortunately, it also doesn't clear the dialog, and that's where I'm hitting a wall. If I add either history.back() or $.mobile.changePage('#previousPageSelector') before the return, I get TypeError messages, and jQM's history and page navigation breaks.
How can I send users back to where they need to be?