Print Page | Close Window

Javascripts ??

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=4824
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascripts ??
Posted By: jellejacob
Subject: Javascripts ??
Date Posted: 07 August 2003 at 3:33am

Hi All,

I'm using a Pop-up confirm message javascipt. When I'm applying this javascript to a submit button with the onclick event, the form in which the button is located, still submits even when I hit "NO" The form contains several onsubmit javascript actions.
Does anybody know how I can solve this problem?

Here's the code that I'm using:

Here's the code that's in the <HEAD> section

<script language="JavaScript" type="text/JavaScript">
<!--

function GP_popupConfirmMsg(msg) { //v1.0
document.MM_returnValue = confirm(msg);
}
//-->
</script>

<script language="javascript" src="../ScriptLibrary/incPureUpload.js"></script>


Here's the code from the formaction:

<form ACTION="<%=MM_editAction%>" METHOD="POST" enctype="multipart/form-data" name="frm_AddNew" id="frm_AddNew" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','','','','','');showProgressWindow('fileCopyProgress.htm',300,100);return document.MM_returnValue">

This is the code for the submit button:

<input name="Toevoegen" type="submit" class="InputTypeButton" id="Toevoegen" onClick="GP_popupConfirmMsg('U staat op het punt een kavel toe te voegen. Wilt u doorgaan?');YY_checkform('frm_AddNew','Adres','#q','0','s.v.p. een adres invullen.','Plaats','#q','0','s.v.p. een plaats invullen.','Vraagprijs','#q','0','s.v.p. een vraagprijs invullen');return document.MM_returnValue" value="Toevoegen" />


Hope someone can help out.

Thanks in advance




Replies:
Posted By: Flamewave
Date Posted: 07 August 2003 at 9:41am

<script language="JavaScript" type="text/JavaScript">
<!--

function GP_popupConfirmMsg(msg) { //v1.0
return confirm(msg);
}
//-->
</script>

<form ACTION="<%=MM_editAction%>" METHOD="POST" enctype="multipart/form-data" name="frm_AddNew" id="frm_AddNew" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','','','','','');showProgressWindow('fileCopyProgress.htm',300,100);return GP_popupConfirmMsg('Are you sure?')">

<input name="Toevoegen" type="submit" class="InputTypeButton" id="Toevoegen" onClick="YY_checkform('frm_AddNew','Adres','#q','0','s.v.p. een adres invullen.','Plaats','#q','0','s.v.p. een plaats invullen.','Vraagprijs','#q','0','s.v.p. een vraagprijs invullen');" value="Toevoegen" />



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net