Modal not staying open

I have a page that uses a modal window containing a form. When I invoke the form from a button, it works as expected. When I call the modal from a dynamic link (to populate the content of the form) the modal flashes open, then hides immediately.

I’ve tried placing the modal in different

locations, to see if that was relevant, but the results are them.

Here is the button code:
<button class="btn btn-outline-success" dmx-on:click="modal1.show();modal1.ticket_detail.select(0)"><i class="fa fa-plus-circle"></i> New Change Slip</button>

Here is the code from the dynamic link:
<td align="center"><a href="" dmx-on:click="modal1.show();modal1.ticket_detail.select(changeID)"><i class="fa fa-pencil-square-o"></i></a></td>

I may not be correct, but to me it looks like once the modal is opened, you apply the select to it. What happens if you reverse those two, first select de detail and then open the modal.

Just a thought.

Yes. I’ve tried it both ways.

I placed them in the current order because that was the same sequence as the method that was working properly.

Are you sure your page doesn’t just refresh because of that href?
Maybe try adding href="#" or href=“javascript:void(0);”

EDIT: yes, it’s the empty href which reloads your page. It’s not the modal that closed - but the whole page reloads.

Thank you Teodor.

That fixed the issue.
(I should have already known that…:roll_eyes:)

1 Like