How can I send a modal with booststrap or some div with a text box?

0

I have the following table, the part of the buttons when pressing them, they consult a data and the table is repainted with the data, what I need is that if the data of the query does not exist, I can enter the amount manually. And I thought I would do it in a modal but I do not know how to send it to call.

$n_f1_1 = function(){        

      console.log(arguments[0]);
      console.log(arguments[1]);

      $.post("pages/reporte/nuevo/post/nutriente/f1_n.php", {ID: arguments[0],ID_NUTRIENTE: arguments[1]}, function(mensaje) {
        $("#T").html(mensaje);
     });

      $('#paso3').load('pages/reporte/nuevo/post/nutriente/refrsh_table.php');

    };

This is the function with which the table is uploaded and refreshed. Thanks for the support

    
asked by GERMAN SOSA 15.09.2018 в 23:45
source

1 answer

0

There are several ways to do it. It occurs to me to put it on a button and call it with jQuery, for example

<button onclick="ShowModal()" class="btn btn-primary">Mostrar</button>

<!-- Modal -->
<div class="modal fade" id="exampleModal" 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="exampleModalLabel">Titulo</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Cerrar</button>
        <button type="button" class="btn btn-primary">Aceptar changes</button>
      </div>
    </div>
  </div>
</div>

<script>
  function ShowModal(){
     $('#myModal').modal('show')
  }
</script>

Note: I'm using bootstrap 4

More information on the official bootstrap site link

    
answered by 16.09.2018 в 01:32