(e-mail address removed) skrev:
hi Frnds,
I need Confirm box with "yes" or "no" buttons, Is that
possible in JAVASCRIPT ,
Can anyone tell me the solution for this or anyother way to create
confirm box with "yes" or "no" button?
You can't do that with a popup box in JavaScript. You could launch a
web page with window.open, but that would require a trip to the server.
At work many people don't have Java or ActiveX enabled. If you don't
want the confirmation on the "next page" you may use a hidden div
element.
Maybe this code from the archive at
www.codingforums.com
(
http://www.codingforums.com/archive/index.php?t-19975.html) could help
you:
<SCRIPT language="JavaScript">
<!--
function showHide(layerid){
if (document.getElementById(layerid).style.visibility != "hidden"){
document.getElementById(layerid).style.visibility = "hidden";
}
else{
document.getElementById(layerid).style.visibility = "visible";
}
}
function yours(){
alert("This is where your function should be")
}
// -->
</SCRIPT>
<P align="center"><a class=lined href="#null"
onclick="showHide('box2')"><b>Confirm Alert</b></a>
<DIV id="box2" style="position:absolute;left:350;top:150;
width:250;color:#FFFFFF;border-top:2px solid #ffffff; border-left:2px
solid #ffffff; border-right:2px solid #808080; border-bottom:2px solid
#808080; background:#d8cfc8;visibility:hidden;text-align:center">
<div
style="height:18;font-size:12;text-align:left;filter
rogid
XImageTransform.Microsoft.Gradient(GradientType=1,
StartColorStr='#FF005500', EndColorStr='#FF00ff00')">Your Site
Name</div>
<P><center><font color="black" size=2>Is this what your really
want?</font></center>
<form>
<span style="position:relative;left:0;top:0;width:75;height:22;border:1
groove #000000">
<input type=button value="Yes"
style="width:74;height:20;font-size:10;border:1px outset #ffffff;"
onclick="yours();showHide('box2')" >
</span>
<span
style="position:relative;left:10;top:0;width:75;height:22;border:1
groove #000000">
<input type=button value="No"
style="width:74;height:20;font-size:10;border:1px outset #ffffff;"
onclick="showHide('box2')">
</span>
</form>
</DIV>