Georgi, as I thought about it some more, I place an onclientclick event of the submit button and the below js works perfectly.
Here is the completed js code which works perfectly using the onclientclick event of the submit button.
<code>
function CheckForOtherIns() {
var tabStrip = $find("<%= tsPatientDemographics.ClientID %>");
var selectedTab = tabStrip.get_selectedTab();
var hdnOtherIns = document.getElementById("hdnOtherIns");
hdnOtherIns.value = "0";
if (selectedTab != null) {
var selectedTabValue = selectedTab.get_text();
if (selectedTabValue == "Pri Ins") {
if (confirm("Is there Secondary or Tertiary Insurance information available?")) {
selectSecTab();
hdnOtherIns.value = "1";
return false;
}
else {
return true;
}
}
else if (selectedTabValue == "Sec Ins")
if (confirm("Is there Tertiary Insurance information available?")) {
selectTerTab();
hdnOtherIns.value = "1";
return false;
}
else {
return true;
}
}
}
function selectSecTab() {
var tabStrip = $find("<%= tsPatientDemographics.ClientID %>");
var tab = tabStrip.findTabByText("Sec Ins");
tab.select();
}
function selectTerTab() {
var tabStrip = $find("<%= tsPatientDemographics.ClientID %>");
var tab = tabStrip.findTabByText("Ter Ins");
tab.select();
}
</code>