I'm having a small problem with ajax requests being fired multiple times using the jBox tooltips jquery plugin.
I basically have a form setup within a tooltip displayed using ajax. The first time I submit the form (via ajax), it submits only once. However, if I close and open the tooltip multiple times and then submit the form again, it'll fire for as many times as I opened the tooltip.
How do you stop this?
This is my code to initiate the jBox tooltips:
var tooltip = new jBox('Tooltip', {
attach: $('.tooltip'),
onOpen: function(){
// Get the ajax url if it's set
if (this.source.data('ajax-url') != undefined) {
this.options.ajax.url = this.source.data('ajax-url');
} else {
this.options.ajax.url = null;
}
},
preventDefault: true,
trigger: 'click',
closeOnClick: 'body',
width: 350,
height: 'auto',
zIndex: 1000,
ajax: {
reload: true,
cache: false,
setContent: true
}
});