0

The bootstrap modal window which appears on clicking "Add Column" won't reset once closed. As a result, I'm not able to add more than one value to the "Master table". The below code doesn't seem to work:

$('body').on('hidden.bs.modal', '.modal', function () {
        $(this).removeData('bs.modal');
    });

Not sure what is going wrong. Can anyone help?

Here is the JSFiddle: http://jsfiddle.net/xjmf8qqt/10/

j08691
  • 197,815
  • 30
  • 248
  • 265
zer0
  • 4,017
  • 6
  • 26
  • 46

1 Answers1

0

You are not able to add more than one row because of repeating ID attributes. Inside the #modalAdd method you are appending a new row which has a td like this <td id="colName">. Because of this repeating ID attribute $('#colName').val() is not working any more.

About removeData I guess it works only for remote Data as pointed out here Twitter bootstrap remote modal shows same content everytime

Community
  • 1
  • 1
Dhiraj
  • 32,144
  • 8
  • 59
  • 77