Skip to content
Advertisement

Modal validation using Bootstrap Modal – PHP

PHP Script & Validation:

JavaScript

Modal:

JavaScript

I don’t know where the problem is, I want the modal to remain open even if the problem or form has been submitted successfully. Now, with this code, if there is a problem with the submit form, the modal shuts down and if we open it again, the user can see error messages. Where am I wrong?

Advertisement

Answer

After a whole day, I resolve an issue with this.

JavaScript

With this code written above, a modal will be closed only if the user clicks on the close button. With this code, you disabled the close modal by pressing the ESC button on the keyboard.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement