Is there any confirm box with "yes" or "no" option

  • Thread starter balakrishnan.dinesh
  • Start date
B

balakrishnan.dinesh

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?

Thanks & Rgrds
Dinesh...
 
P

pangea33

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?

Thanks & Rgrds
Dinesh...

I've only been able to do this with a little java applet, or by
launching a simple web page containing a form with the relevent buttons.
 
E

Erwin Moller

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?

Thanks & Rgrds
Dinesh...

No, you can not.
If you must, first try Riks advise, and simply try to rephrase your question
and stick with OK and Cancel.
If that doesn't fit your needs, you can always make a small popup that looks
like a confirm (sort of) with 2 buttons.
But I have never ever had a situation in which rephrasing the question
didn't work..

Regards,
Erwin Moller
 
R

Roy A.

(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:progid:DXImageTransform.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>
 
R

Roy A.

Roy A. skrev:
<div
style="height:18;font-size:12;text-align:left;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,
StartColorStr='#FF005500', EndColorStr='#FF00ff00')">Your Site
Name</div>

You may want to style the contents of det div and span elements so that
they look good in any browser beside of IE. Mayby get rid of that silly
Gradient filter and replace it with background-color: #3333ff, or
something like that; get rid of the font-tag and IE-styles like outset.
Sorry. I hope you can deal with that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top