IE is the bane of my existence. Basically, I want to run validation from a button within the tab if the user tries to skip tabs- to prevent them from not filling in data and potentially breaking my database queries.
$("[id$='tab_TabContainer1_TabPanel2']").click(function (e) {
var container = $find('TabContainer1');
if (event.preventDefault) {
event.preventDefault(); //works for anything with preventDefault (e.g., not called from html onclick, etc.)
}
else {
event.returnValue = false; //supposed to be IE specific - on global event 'event'
}
$("[id$='Button1']").click(); //perform the button1 click event (which calls custom validation)
if (Page_IsValid) {
container.set_activeTabIndex(1); //go ahead to next tab
}
else {
container.set_activeTabIndex(0); //stay here on current tab
}
return false;
});
It should be that simple, and the above works in firefox/google chrome, but not IE8. IE8 simply just goes to the next tab after the validation, regardless of anything. Even if I return false; immediately, it just goes to the next tab. Honey Badger doesn't care, honey badger just goes to the next tab. Any ideas?