• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

popup to confirm delete doesn't work on all situations

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing to do with JSP, so moved to the HTML forum.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
probably something in your validation function.

Eric
 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean when you say "my validation function ???

Mariane
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic