Hi Romans,
I have come up with following.
I trigger a function in my own js file
$tabs->js(true)->bind('tabsbeforeactivate',$this->js()->univ()->warn_tab_changes()->_enclose(null,false));
the function looks like this.
$.each({
warn_tab_changes: function() {
var myList = document.getElementsByClassName("form_changed");
if (myList.length) {
if (!confirm('Changes on the form will be lost. Continue?')){
event.preventDefault();
return false;
}
else{
myList[0].className="";
return true;
}
} else
{
return true;
}
return false;
},
.
.
.
It triggerrs whenever I switch between tabs and it pics up the form changes, but whn I click cancel instead of ok to proceed the tabs changes in anycase.
Any Idea what im doing wrong?
Regards,
Willem