confirm window with (Y) & (N) ????

T

Terry

anyone know how to pop up a confirm window with (Y) & (N)??
I want to pop up a "Do you want to continue?" message box (javascript
only, can't use vbscript) with (Y) & (N). when click (N), then close
the current window. If click (Y), then back to server side to
continue. Is it possible?? Thanks a lot.
 
R

Randy Webb

No, you can not change the confirm dialog window.

Here is the code from that page:

<script language="JavaScript">

language is deprecated, use the type attribute instead.

SGML Delimiters are not needed.
function confirm_entry()
{
input_box=confirm("Click OK or Cancel to Continue");
if (input_box==true)

confirm returns only two values, true and false. You can simply test
input_box:

if(input_box)
{
// Output when OK is clicked
alert ("You clicked OK");
}

else
{
// Output when Cancel is clicked
alert ("You clicked cancel");
}

}

Every bit of that code could be written as:

function confirm_entry(){
if (confirm("Click OK or Cancel to Continue"){
alert("You clicked OK")
}else{
alert("You didn't click OK")
}
}

Thats technically a syntax error that browsers correct. If you are
intent on using SGML Delimites, the closing one must be //--> for it to
be correct.
</script>
Click <a href="JavaScript:confirm_entry()">here</a>

And if javascript is disabled? Your link doesn't work. See:
http://jibbering.com/faq/#FAQ4_24

All in all, the code you linked to is pretty shabby.
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top