I need the user to choose either choice on the decision box before they go for next page. Right now the problem is if the user click close "X" on popup box, they can proceed for next page without choosing the choice. How can i do validate from here? Any help would be appreciated. Thanks
Javascript Code
var winConfirm = null;
function showConfirm() {
var windowWidth = 250;
var windowHeight = 100;
var locX = (screen.width - 150 - windowWidth) / 2;
var locY = (screen.height - 50 - windowHeight) / 2;
var windowFeatures = "width=" + windowWidth + ",height=" + windowHeight + ",screenX=" + locX + ",screenY=" + locY + ",left=" + locX + ",top=" + locY;
if ((winConfirm != null) && !winConfirm.closed) {
winConfirm.close();
}
winConfirm = open("menubar = no", "winConfirm", windowFeatures);
var theHTML = '' + '<BODY BGCOLOR="#DDDDDD">' +
'<CENTER><B><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF0000">' + 'Please choose ?' + '</B></CENTER><FORM NAME="buttonForm"><BR/>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD width="40" ALIGN="CENTER"> </TD>
<TD>' + '<INPUT TYPE="button" NAME="buttonname" VALUE="YES" STYLE="WIDTH:60;HEIGHT:30;FONT-WEIGHT:BOLD;" ONCLICK="self.close();opener.buttonClicked(0);">' + ' ' + '</TD>
<TD ALIGN="CENTER"><INPUT TYPE="button" NAME="buttonname" VALUE="NO" STYLE="WIDTH:60;HEIGHT:30;FONT-WEIGHT:BOLD;" ONCLICK="self.close();opener.buttonClicked(1);">' + '</TD>
<TD WIDTH="40"> </TD>
</TR></TABLE></FORM></BODY>';
winConfirm.document.writeln(theHTML);
}
function buttonClicked(buttonChoice) {
var CONTACT_ID = "<%=CONTACT_ID%>";
switch (buttonChoice) {
case 0:
winConfirm.close();
break;
case 1:
popupWindow('/eascb/common/search/pop_contact_update_0.jsp');
break;
default:
popupWindow('pop_covernote_add_0.jsp');
}
}