aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes popup to confirm delete doesn't work on all situations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "popup to confirm delete doesn Watch "popup to confirm delete doesn New topic
Author

popup to confirm delete doesn't work on all situations

Maresq Mariane
Greenhorn

Joined: Jul 13, 2005
Posts: 7
Hello,

I use in my JSP page the following code :
input type="submit" name="action" value="delete" onklick="javascript:return confirm('Are you sure you want to delete ?')"

In one JSP page, it works fine, when popup appears, If I click on "stop" , I stay into JSP Page and nothing is done.
In another page, when I click on "stop" button , action is purchased...

The only difference I see between this two pages is that the bad one is a form with enctype=multipart form-data and not the good one.

Do you think the problem comes from that difference ?
Do you have a solution to propose to me ?

Thank you for your answer.
Mariane.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61594
    
  67

Nothing to do with JSP, so moved to the HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
try it wothout the javascript keyword..

onclick="return confirm('Are you sure you want to delete ?');"
Maresq Mariane
Greenhorn

Joined: Jul 13, 2005
Posts: 7
Hello, I tryed this solution but it doesn't work.

BUT, I know from what the problem comes :

I have 4 lines in my wrong JSP page :
<script language="javascript" src="cal2.js"></script>
<script language="javascript"src="cal_conf2.js"></script>
<script type="text/javascript" src="verifLength.js"></script>
<script type="text/javascript" src="linkedSelect.js"></script>

If I delete this 4 lines,
onklick="return confirm('Are you sure you want to delete ?')" WORKS !!!

Do you have any idea ???

Thanks for you help.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
probably something in your validation function.

Eric
Maresq Mariane
Greenhorn

Joined: Jul 13, 2005
Posts: 7
What do you mean when you say "my validation function ???

Mariane
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I mean this...
<script type="text/javascript" src="verifLength.js"></script>

Figure out which one is causing the problem...Paste each one individually to the page and see if it breaks.

Eric
Maresq Mariane
Greenhorn

Joined: Jul 13, 2005
Posts: 7
Thank you very much.

It was one of my .js that caused the error.

If I delete the following lines, it's OK.

function markClick(e) {
if (isIE || isOpera6) {
winX=event.screenX;
winY=event.screenY;
}
else if (isN4 || isN6) {
winX=e.screenX;
winY=e.screenY;

document.routeEvent(e);
}

if (isN4 || isN6) {
document.routeEvent(e);
}
else {
event.cancelBubble=false;
}

return true;
}

if (isN4 || isN6) {
document.captureEvents(Event.CLICK);
}
document.onKlick=markClick;


Do you know what this code makes ?

Regards Mariane
Bert Evans
Greenhorn

Joined: Jun 30, 2005
Posts: 11
Well, for one, its not complete code. There is just one function defined and then a couple lines of code outside that function. Throughout it references variables that are not defined by the script (if that is the whole script) and document.onKlick is undefined. Unless you have other code that is supposed to work with this code, you should definitely pull it out.

Bert Evans
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: popup to confirm delete doesn't work on all situations