If we make use of the Tab groups in custom pages for the custom entity, sometimes we get unnecessary crashing errors after clicking on tab twice.
Using this script you can restrict user not to click tab again, once the page is submitted.
You can mould this script for any content according to your requirement.