Hi,
Does anybody know how to convert the following code, so that I the popup will have buttons instead of anchor tags?
Here's the code:
[CODE=html]<html>
<script language=JavaSc ript>
var ModalDialogWind ow;
var ModalDialogInte rval;
var ModalDialog = new Object;
ModalDialog.val ue = '';
ModalDialog.eve nthandler = '';
function ModalDialogMain tainFocus()
{
try
{
if (ModalDialogWin dow.closed)
{
window.clearInt erval(ModalDial ogInterval);
eval(ModalDialo g.eventhandler) ;
return;
}
ModalDialogWind ow.focus();
}
catch (everything) { }
}
function ModalDialogRemo veWatch()
{
ModalDialog.val ue = '';
ModalDialog.eve nthandler = '';
}
function ModalDialogShow (Title,BodyText ,Buttons,EventH andler)
{
ModalDialogRemo veWatch();
ModalDialog.eve nthandler = EventHandler;
var args='width=350 ,height=125,lef t=325,top=300,t oolbar=0,';
args+='location =0,status=0,men ubar=0,scrollba rs=1,resizable= 0';
ModalDialogWind ow=window.open( "","",args) ;
ModalDialogWind ow.document.ope n();
ModalDialogWind ow.document.wri te('<html>');
ModalDialogWind ow.document.wri te('<head>');
ModalDialogWind ow.document.wri te('<title>' + Title + '</title>');
ModalDialogWind ow.document.wri te('<script' + ' language=JavaSc ript>');
ModalDialogWind ow.document.wri te('function CloseForm(Respo nse) ');
ModalDialogWind ow.document.wri te('{ ');
ModalDialogWind ow.document.wri te(' window.opener.M odalDialog.valu e = Response; ');
ModalDialogWind ow.document.wri te(' window.close(); ');
ModalDialogWind ow.document.wri te('} ');
ModalDialogWind ow.document.wri te('</script' + '>');
ModalDialogWind ow.document.wri te('</head>');
ModalDialogWind ow.document.wri te('<body onblur="window. focus();">');
ModalDialogWind ow.document.wri te('<table border=0 width="95%" align=center cellspacing=0 cellpadding=2>' );
ModalDialogWind ow.document.wri te('<tr><td align=left>' + BodyText + '</td></tr>');
ModalDialogWind ow.document.wri te('<tr><td align=left><br> </td></tr>');
ModalDialogWind ow.document.wri te('<tr><td align=center>' + Buttons + '</td></tr>');
ModalDialogWind ow.document.wri te('</body>');
ModalDialogWind ow.document.wri te('</html>');
ModalDialogWind ow.document.clo se();
ModalDialogWind ow.focus();
ModalDialogInte rval = window.setInter val("ModalDialo gMaintainFocus( )",5);
}
</script>
<script language=JavaSc ript>
function YesNo(BodyText, EventHandler)
{
var Buttons='';
Buttons = '<a href=javascript :CloseForm("Yes ");>Yes</a> ';
Buttons += '<a href=javascript :CloseForm("No" );>No</a> ';
ModalDialogShow ("Dialog",BodyT ext,Buttons,Eve ntHandler);
}
function YesNoReturnMeth od()
{
document.getEle mentById('modal return1').value = ModalDialog.val ue;
ModalDialogRemo veWatch();
}
</script>
<BODY >
<table border=0 cellpadding=0 cellspacing=0 align=center width="60%">
<tr><td align=left></td></tr>
<tr><td align=left></td></tr>
<tr><td align=left></td></tr>
<tr>
<td align=left>
<input type=text id=modalreturn1 name=modalretur n1 value=''>
<a href="javascrip t:YesNo('Are You Sure?',
'YesNoReturnMet hod()');">Click To Confirm</a>
</td>
</tr>
</table>
</BODY>
</HTML>[/CODE]
Thanks in advance.
Does anybody know how to convert the following code, so that I the popup will have buttons instead of anchor tags?
Here's the code:
[CODE=html]<html>
<script language=JavaSc ript>
var ModalDialogWind ow;
var ModalDialogInte rval;
var ModalDialog = new Object;
ModalDialog.val ue = '';
ModalDialog.eve nthandler = '';
function ModalDialogMain tainFocus()
{
try
{
if (ModalDialogWin dow.closed)
{
window.clearInt erval(ModalDial ogInterval);
eval(ModalDialo g.eventhandler) ;
return;
}
ModalDialogWind ow.focus();
}
catch (everything) { }
}
function ModalDialogRemo veWatch()
{
ModalDialog.val ue = '';
ModalDialog.eve nthandler = '';
}
function ModalDialogShow (Title,BodyText ,Buttons,EventH andler)
{
ModalDialogRemo veWatch();
ModalDialog.eve nthandler = EventHandler;
var args='width=350 ,height=125,lef t=325,top=300,t oolbar=0,';
args+='location =0,status=0,men ubar=0,scrollba rs=1,resizable= 0';
ModalDialogWind ow=window.open( "","",args) ;
ModalDialogWind ow.document.ope n();
ModalDialogWind ow.document.wri te('<html>');
ModalDialogWind ow.document.wri te('<head>');
ModalDialogWind ow.document.wri te('<title>' + Title + '</title>');
ModalDialogWind ow.document.wri te('<script' + ' language=JavaSc ript>');
ModalDialogWind ow.document.wri te('function CloseForm(Respo nse) ');
ModalDialogWind ow.document.wri te('{ ');
ModalDialogWind ow.document.wri te(' window.opener.M odalDialog.valu e = Response; ');
ModalDialogWind ow.document.wri te(' window.close(); ');
ModalDialogWind ow.document.wri te('} ');
ModalDialogWind ow.document.wri te('</script' + '>');
ModalDialogWind ow.document.wri te('</head>');
ModalDialogWind ow.document.wri te('<body onblur="window. focus();">');
ModalDialogWind ow.document.wri te('<table border=0 width="95%" align=center cellspacing=0 cellpadding=2>' );
ModalDialogWind ow.document.wri te('<tr><td align=left>' + BodyText + '</td></tr>');
ModalDialogWind ow.document.wri te('<tr><td align=left><br> </td></tr>');
ModalDialogWind ow.document.wri te('<tr><td align=center>' + Buttons + '</td></tr>');
ModalDialogWind ow.document.wri te('</body>');
ModalDialogWind ow.document.wri te('</html>');
ModalDialogWind ow.document.clo se();
ModalDialogWind ow.focus();
ModalDialogInte rval = window.setInter val("ModalDialo gMaintainFocus( )",5);
}
</script>
<script language=JavaSc ript>
function YesNo(BodyText, EventHandler)
{
var Buttons='';
Buttons = '<a href=javascript :CloseForm("Yes ");>Yes</a> ';
Buttons += '<a href=javascript :CloseForm("No" );>No</a> ';
ModalDialogShow ("Dialog",BodyT ext,Buttons,Eve ntHandler);
}
function YesNoReturnMeth od()
{
document.getEle mentById('modal return1').value = ModalDialog.val ue;
ModalDialogRemo veWatch();
}
</script>
<BODY >
<table border=0 cellpadding=0 cellspacing=0 align=center width="60%">
<tr><td align=left></td></tr>
<tr><td align=left></td></tr>
<tr><td align=left></td></tr>
<tr>
<td align=left>
<input type=text id=modalreturn1 name=modalretur n1 value=''>
<a href="javascrip t:YesNo('Are You Sure?',
'YesNoReturnMet hod()');">Click To Confirm</a>
</td>
</tr>
</table>
</BODY>
</HTML>[/CODE]
Thanks in advance.
Comment