How to bind dynamic data in one bootstrap modal

前端 未结 1 487
天命终不由人
天命终不由人 2021-02-14 11:03

I have one modal in my form

1条回答
  •  无人及你
    2021-02-14 11:17

    You can pass a dynamic variable to a function and then in the function you can use that variable to 'manually' open the modal:

    
    

    In your javascript you can access that like this:

    function showModal(data)
    {
       //you can do anything with data, or pass more data to this function. i set this data to modal header for example
       $("#myModal .modal-title").html(data)
       $("#myModal").modal();
    }
    

    0 讨论(0)
提交回复
热议问题