Different default behaviour on form submits
Hi
When a form gets submitted jqm will ajax post the data and change the page url hash. Changing the page url hash is somehow uncomfortable for CRUD apps.
Starting updating or creating database entries is more like a
self-contained process. I like to hit submit several times, type in values, getting errors, type in better values submitting again and so on until i get a success page at last. Over the hole process i expect the back button pointing to the entry point of the hole update process. I think this would be a very nice default behaviour.
To get this beaviour i changed the
1.0a4
core like this:
from:
- ORIGINAL
- $( "form" ).live('submit', function(event){
- .
- ....snipp
- .
- $.mobile.changePage({
- url: url.length && url || path.get(),
- type: type.length && type.toLowerCase() || "get",
- data: $(this).serialize()
- },
- $(this).jqmData("transition"),
- $(this).jqmData("direction"),
- true //
- );
- .
- ....snapp
- .
To this:
-
- PATCHED
- $( "form" ).live('submit', function(event){
- .
- ....snipp
- .
- $.mobile.changePage({
- url: url.length && url || path.get(),
- type: type.length && type.toLowerCase() || "get",
- data: $(this).serialize()
- },
- $(this).jqmData("transition"),
- $(this).jqmData("direction"),
- false //DISABLE CHANGEHASH
- );
- .
- ....snapp
I suggest to make changeHash configurable to form submission and change the default to false
Cheers
Stefan