How do I process a form submit using asynchrony?
There is a form with a button (type = 'submit'), an EventListener ('submit', handleFormSubmit) hangs on the button. Inside the asynchronous function handleFormSubmit, you need to write a code that will make a modal window visible with certain information with a button, by clicking on which the form will be submitted. The question is how to make the form submission "freeze" until the button is pressed in the modal window:
You just interrupt the submit (
preventDefault ()), show the modal, and after clicking the button inside the modal, manually call the
submitof this form again, this time without interfering.
(one call from another can be distinguished by setting a certain flag or simply by some event property, the same
To place the code, please use CodePen or similar tool. Thanks you!