Skip to main content
December 1, 2008
Answered

Yes/No dialog box

  • December 1, 2008
  • 2 replies
  • 534 views
Is there an off-the-shelf way to produce a Yes/No dialog box to be displayed when the user tries to delete a record? Doesn't matter if the text is something different from Yes/No.
This topic has been closed for replies.
Correct answer Newsgroup_User
Just put the confirm on the link
<a onclick="return confirm('do you really want to delete this?');"
href="....


"RSW14" <webforumsuser@macromedia.com> wrote in message
news:gh17q0$pjs$1@forums.macromedia.com...
> Should have said - that the deletion happens as a result of selecting a
> 'delete' link. There's no form involved.


2 replies

Inspiring
December 1, 2008
i usually have a check box and when its checked it will allow my form to be
submitted.

paste below onto a page and see if u can make sense of it. I got the code a
few years ago from Marja from flevooware.nl




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
" http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Guinness drinkers unite</title>

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms ;
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers
.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function flvFTFO1(){//v1.11
// Copyright 2003, Marja Ribbers-de Vroed, FlevOOware
(www.flevooware.nl/dreamweaver/)
if (!document.layers){var
v1=arguments,v2=MM_findObj(v1[0]),v3,v4,v5,v6,v7,v8,v9,v10;if (v2){for
(v3=1;v3<v1.length;v3++){v6=v1[v3].split(",");v7=v6[0];v8=v6[1];v10=false;for
(v4=0;v4<v2.length;v4++){v5=v2[v4];if
(v5.id==v7||v5.name==v7){v10=true;break;}}if
(!v10){v5=MM_findObj(v7);v10=(!v5)?false:true;}if (v10){if
(v8=="t"){v5.disabled=!v5.disabled;}else
{v9=(v8=="e")?false:true;v5.disabled=v9;}}}}}}
//-->
</script>
</head>
<body>
<form action="#" method="post" name="theForm">

<p align="center">
<input name="chkAgree" type="checkbox"
onClick="flvFTFO1('theForm','btnSubmit,t')" value="True">
I've want to delete this record.</p>

<input name="btnSubmit" type="submit" disabled="true"
value="delete">


</form>
</body>
</html>


Inspiring
December 1, 2008
The simplest way is to tie a javascript confirm to the form
<form onsubmit="return confirm('do you really want to delete
this?');".......>
You can use whatever message you like but the options (non-changeable) will
be OK or Cancel.


"RSW14" <webforumsuser@macromedia.com> wrote in message
news:gh15gl$mqt$1@forums.macromedia.com...
> Is there an off-the-shelf way to produce a Yes/No dialog box to be
> displayed when the user tries to delete a record? Doesn't matter if the
> text is something different from Yes/No.


December 1, 2008
Should have said - that the deletion happens as a result of selecting a 'delete' link. There's no form involved.