View Full Version : Confirm
zoobie
09-12-2002, 03:10 AM
When the user clicks on 'Ok' or 'cancel', it's still submits. Fix? Thanks
<script>
var correct = false;
function checkData() {
var var1 = document.mail.receiver.value;
if ( correct == false ) {
if (document.myform.receiver.value == "") {alert("Please enter email address!"); return false;}
if (document.myform.graphic.value == "") {alert("Please select your graphic!"); return false;}
if (document.myform.comments.value == document.myform.comments.defaultValue) {alert(" Please type your comments!"); return false;}
if (document.myform.comments.value == "") {alert(" Please type your comments!"); return false;}
confirm(" Email is being sent to: " + var1 + "\n Is this correct?")
return true;
}
}
</script>
glenngv
09-12-2002, 06:51 AM
<script>
var correct = false;
function checkData() {
var var1 = document.mail.receiver.value;
if ( correct == false ) {
if (document.myform.receiver.value == "") {alert("Please enter email address!"); return false;}
if (document.myform.graphic.value == "") {alert("Please select your graphic!"); return false;}
if (document.myform.comments.value == document.myform.comments.defaultValue) {alert(" Please type your comments!"); return false;}
if (document.myform.comments.value == "") {alert(" Please type your comments!"); return false;}
return confirm(" Email is being sent to: " + var1 + "\n Is this correct?")
}
}
</script>
__________________
zoobie
09-12-2002, 04:03 PM
Thanks Glenn :D
Guess I was returnig everything true.
webmarkart
08-28-2003, 03:15 PM
okay I'm experiencing the same problem... I tried to fix it using the example above but I got all sorts of errors... any ideas?
<script language="javascript">
function valdelete(form)
{
if (form.CONTACT_TYPE_ID.value=="")
{
alert('Please Select a Contact Type to delete');
form.CONTACT_TYPE_ID.focus();
return;
}
else (confirm("All contacts with this type will have no classification. \n Are you sure you want to delete this Contact Type?"))
{
form.submit();
}
}
</script>
<FORM ACTION="default.asp?action=deletetype" METHOD="POST">
<TR>
<TD><FONT FACE="Tahoma" SIZE="-1">Contact Type:</FONT></TD>
<TD><!--#include file="type.inc"-->
<SELECT NAME="CONTACT_TYPE_ID" SIZE="1">
<OPTION VALUE="">
<%= Typeslist %>
</SELECT></TD>
</TR>
<TR>
<TD> </TD>
<TD><FONT FACE="Tahoma" SIZE="-2" COLOR="#000099">
Select the Contact Type you would like to delete</FONT></TD>
</TR>
<TR>
<TD COLSPAN="2"><IMG SRC="images/white1.gif" BORDER=0 ALT="" HEIGHT="8"></TD>
</TR>
<TD ALIGN="CENTER" CLASS="input" COLSPAN="2">
<INPUT TYPE="button" CLASS="input" VALUE="Delete Contact Type" onClick="valdelete(this.form)">
</TD>
</FORM>
Vincent Puglia
08-28-2003, 03:37 PM
Hi,
else
{
if (confirm("All contacts with this type will have no classification. \n Are you sure you want to delete this Contact Type?"))
{
alert('deleted')
// form.submit();
}
}
Vinny
webmarkart
08-28-2003, 03:49 PM
Once again the fast (and correct) reply confirms that this is the best forum... Thanks Vinny
Vincent Puglia
08-28-2003, 05:16 PM
is the best forum... Thanks Vinny
Thank you; but actually, I beg to differ -- as my sig demonstrates
:D
Vinny
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.