What is the best way to handle forms in jqm?
For example, you can say that the user fills out a form, and some data is not checked. It is not picked up by JS validation, but it invokes some business logic, which means that the system cannot continue.
In jqm, the form will be returned to the user, and the structure will load it and move to it. Suppose I donβt want this to be oriented as a new condition β I just want it to display an updated form with an error message. I also don't want to disable ajax, as this adds an unnecessary full page reload.
Ideally, what I would like is a way to tell jqm not to go over or include the answer in the story, but just show it instead of what it is.
The only way to see how this works is to write my own small form handler and return the JSON from the server, which includes the error state. If the view was good, go to the next page, otherwise update the html in the view with the html returned as part of the JSON object that contains any error messages.
There seems to be a better way?
thanks
source share