A simple way to catch and retry a failed form submit?

21 views
Skip to first unread message

Horst Horst

unread,
Apr 21, 2017, 7:28:50 AM4/21/17
to web2py-users
On my site (sympathetic-resonances.org), users edit complex forms. Part of the form is musical data passed as JSON in a hidden form field, where a JS frontend reads it from and writes it to. The pages themselves are submitted as regular forms.

I have a few users in countries with very unreliable internet connection. If their form submit fails, edits to the musical data are sometimes lost, depending on the browser. (Firefox offers a Try Again button, Chrome and Safari don't - I wonder why the UX is so bad here in the first place.)

Ideally, if users clicked on a submit button and the site can't be reached, the page with the form would remain unchanged (so you might even continue editing), and a dialog would pop up, indicating the problem and asking to try again later.

Is there a simple way to achieve this with JS and/or web2py? (I realize that this kind of single-page frontend would better communicate with the backend via AJAX, but there's quite some logic (custom validators etc.) tied to the controller, and unless there's a simple way to keep the controller mainly as-is, I don't want to spend the time for this change right now.)

Reply all
Reply to author
Forward
0 new messages