I have a bootstrap modal that have a form and it successfully submitted and get the success message, suppose I want to add a link to the same modal to load the same form from the current open modal.
When I click the link the modal hidden.
this is my link that links to the modal.
<a class="registerBtn" data-toggle="modal" href="#registerModalForm" >Register</a>
Thanks
The way I would approach this is to have the form data in a hidden div (let’s call it
formData) that is completely separate from the modal div. For example:Then create an event, so that when the modal shows, it loads the form data into the body of the modal:
Then finally, add an event to the button that reloads the form (here the button has an id =
myReload:JSFiddle here. (Ignore the code for the submit button, this is just to simulate form submission).