• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

popup to confirm delete doesn't work on all situations

 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to do with JSP, so moved to the HTML forum.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try it wothout the javascript keyword..

onclick="return confirm('Are you sure you want to delete ?');"
 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
probably something in your validation function.

Eric
 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean when you say "my validation function ???

Mariane
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic