Open modal via a HREF with parameters

Asked

Viewed 862 times

-1

Hello, I’m trying to do an editing part on my page, and I thought to use a modal to open the editing window, I did a search, but I did not find exactly...

My modal won’t open.

I’m trying this way:

PHP:

<td>
<a href='#edit-escolaridade?nome=".$cont['nome']."' title='Editar'>
<i class='fas fa-pencil-alt'></i>
</a>
</td>  

HTML (modal):

 <div class="modal fade" id="edit-escolaridade" tabindex="-1" role="dialog" aria-labelledby="mediumModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="mediumModalLabel">Editar escolaridade</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body">
              <p>
               ...
              </p>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
              <button type="button" class="btn btn-primary">Salvar</button>
            </div>
          </div>
        </div>
      </div>

1 answer

0

Data-toggle attribute missing from link.

<a href='#edit-escolaridade?nome=".$cont['nome']."' data-toggle="modal" title='Editar'>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.