I have a button Submit
when clicked performs some operation calling an API. Post click, the button is disabled or basically the initial state of the button and the operation is changed.
I have two or multiple browser tabs which shows same screen of Submit
. If in any one of the tab, the Submit
operation is performed, the other tabs should show the updated version. The other tabs should show the disabled version and should not show the initial state.
How do I achieve this? I am using React, JS
#1 Data duplication MUST be restricted at the server side.
user_id
, or with form_id
, you can create a cache for that, and if you proceed it, store it in the db, other case throws an error. On the other browser you must validate before the submit
if the unique_id
neither in the cache nor in the db
. If exists, you can throws an error in the nr.2 browser.#2 If you want to disable the button, you have to use websockets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With