On Tuesday 30 July 2002 11:16, Stephan Goeldi wrote:
e.g. <FORM ACTION="doStuff" METHOD="POST" onSubmit="confirm('Do you *really* want to do that?')"> If the user hits "OK", the form will be submitted. If they hit "Cancel", the browser will not submit the form.
Hmmm. This is fine. But the document gets deleted anyway. It happens in DocumentLibrary's document_edit method. Anyway, thank you very much for this simple solution.
That example is _very_ simple. This should be like (untested): <script language="JavaScript1.2" type="text/javascript"> <!-- if ((navigator.appName == "Konqueror" && navigator.appVersion.charAt(0) >= 5) || (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "Opera" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "WebTV Plus Receiver" && navigator.appVersion.charAt(0) >= 3)) { document.write("<FORM ACTION=\"doStuff\" METHOD=\"POST\" onSubmit=\"delConfirm()\">"); } else { document.write("<FORM ACTION=\"doStuffViaConfirm\" METHOD=\"POST\" "); } //--> </script> This example will work if JS is turned on. There is "doStuff" which deletes in anyway. There are "doStuffViaConfirm" which do via HTML-based confirm. Then you just determine if user want JS or not. Actually you should write the <FORM> tag with "doStuffViaConfirm" and then if user wants JS ("right" browser for your purposes) and JS is turned on in preferenses -- just delete this form and rewrite it again with JavaScript stuff. In other word -- that what I call "JavaScript masturbations". In other hand, if you like to make disaster to users, who does not like or use JS -- just do this example above. ;-) P.S. Do You still love JavaScr... Segmentation fault. Core dumped -- Sincerely yours, Bogdan M. Maryniuck What's this script do? unzip ; touch ; finger ; mount ; gasp ; yes ; umount ; sleep Hint for the answer: not everything is computer-oriented. Sometimes you're in a sleeping bag, camping out. (Contributed by Frans van der Zande.)