How to handle state of a toggle switch?

by voodoocode   Last Updated May 16, 2018 09:16 AM

I'm wondering about how to create a useful implementation of a toggle switch.

(think iOS style: enter image description here)

It is meant to be used in web applications. Because of that, an important point is, that after switching the toggle on/off in the UI, a request is send to the server, then (sooner or later) the server responds, if the action succeeded or not (via asynchronous JavaScript).

So I used the search and found a similar question with an accepted answer:

Toggle Switch with Delayed State Change

A loading animation while waiting is of course a good idea.

But my question is:

How to handle a failed request?



Related Questions


Ternary Switch - How to implement?

Updated May 16, 2017 14:16 PM

Form with locked and unlocked controls

Updated March 09, 2016 07:06 AM

Boolean switch with a third state

Updated May 15, 2017 10:16 AM

Ideal control design for boolean flags?

Updated June 05, 2015 21:06 PM

Simple POST Form for car insurance agency

Updated April 30, 2015 21:07 PM