azicchetti/jquerymobile-router — Issue #8: Best Practices for Doing Error Dialog?
Author: jevy
Created: 2011-11-29 15:06:16+00:00
State: open

There's little information ANYWHERE on the best way to catch an error in the form and display a dialog.

When I press the "next" button on a page, it checks to see if a field has a valid value. If it does, it sets the value on the model and allows the pagechange to continue as normal. However, if the validation fails, I'd like to redirect to a custom error dialog popup. I do this using the manual "changePage" method. This issue is that the dialog comes up, but quickly changes to the next page as if there was no error.

I think the problem is I have no way to get a handle on the event to call the "preventDefault" method to stop going to the next page. Am I on the right track?

Jevin