Bootstrap 4.1.3 modal body retains jquery returned data. How to clear cache for each new request?

后端 未结 1 770
执笔经年
执笔经年 2021-01-25 03:52

I have a form that submits data via jquery which is then shown via bootstrap modal.

However, the problem is that, if I quickly try to give new values to the form then t

1条回答
  •  礼貌的吻别
    2021-01-25 04:45

    It might be a binding issue, you are binding hidden.bs.modal on the #modalForm so unless you don't unbind it at some point, the same code will always execute with old values.

    Try unbinding it by putting this code $('#modalForm').off('hidden.bs.modal') right before $('#modalForm').on('hidden.bs.modal', function () {[...] and if it doesn't work you might want to bind it only once using the $('#modalForm').one('hidden.bs.modal') instead.

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