S
S
sorry_i_noob2018-05-23 23:54:03
AJAX
sorry_i_noob, 2018-05-23 23:54:03

When the SELECT value changes, the value in the DB changes (via AJAX). Do I need to cancel the SELECT change on the client and do it manually in success?

Hello!
I have a SELECT on my site with a change in the status of a product (changing a field in the database via AJAX). Do I need to cancel the change on the client when changing this SELECT, wait for a response from the server, and if everything is fine, then only change the SELECT value? Or don't bother? How can I do better?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2018-05-24
@LiguidCool

I would do the opposite. If an error is returned, then we cancel the change in the select, and the notification. If “ok” is returned, then we do nothing.
If for beauty, then you can hang a spinner at the time of the request, but often this is an overkill.

A
akrom123, 2014-07-18
@distorting_reality

this is because of the width of the block .f-cr increase its width

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question