Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using bootstrap popover with jquery validation and knockout

I am working on using the Twitter Bootstrap popover to show validation errors from jQuery on a Knockout driven form. I've got it showing the popover fine, but if I have to reload the data (such as on a fetch) while the popover is open, it stays there forever.

I have created a jsFiddle to demonstrate. It can be found here.

To display the problem, just start the Fiddle, click "Add Gift", then click "Submit" (the errors should pop up), then click "Reload"...the errors will stay.

What can I do to fix this?

like image 263
Brian McCord Avatar asked May 07 '26 18:05

Brian McCord


1 Answers

Would it be too simple just to hide the popups in your reload function?

self.reload = function() {
    $(".popover").hide();
    ......
}

http://jsfiddle.net/unklefolk/cmUtX/5/

like image 75
Mark Robinson Avatar answered May 10 '26 19:05

Mark Robinson