0

I am using bootstap to display modal. It works fine. Inside that modal, I have some <a> tags. It displays the link on the left bottom of the screen when hover, but when I click, it just dismiss the modal and not redirect to the link I want. enter image description here

This is a piece of my code in Smarty (inside modal-body)

<li>
   <a href="{BASE_URL}/my/coverletter?code={$template.template_code}&color=clr1"> <span data-theme-cl="1" class="clr-1 theme-cl-1"></span> </a>
</li>

This is my modal

<div class="modal fade choose-letter-modal" id="choose-letter-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
        <h5 class="modal-title" id="choose-letter-modal">{_t('chose_letter_template')}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
        </div>  
        <div class="modal-body">
            // some code write here
        </div>
       </div>
    </div>
</div>

Thank you very much for your help!

Stern
  • 29
  • 6
  • This question solved already, check this https://stackoverflow.com/questions/16152073/prevent-bootstrap-modal-from-disappearing-when-clicking-outside-or-pressing-esca – Muhammad Ubaid Nawaz Nov 01 '22 at 06:06
  • this is not the answer for my question. I tried it but not working. When I click icon in picture above, it dismiss the modal but still not redirect to the url. – Stern Nov 01 '22 at 06:38

1 Answers1

0

Turn out it was my silly mistake that I have data-dismiss modal in my code. That is why when I click, modal is dismiss before it redirect to link.

Sorry for my stupid.

Stern
  • 29
  • 6
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 04 '22 at 04:43