Re: [Zope] form confirmation
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.
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.)
On Tuesday 30 July 2002 16:33, Stephan Göldi wrote:
This example will work if JS is turned on.
The confirmation form will be on an intranet, where only micros~1.oft IE
5.0 will be in use. Well, if they use only MSIE -- it's just for make shorter your presentation time for your boss, not make IE-only product. ;-) I mean, later you can add some more code. BTW, did you ever heard about Apache mod Friday13? You can do something like that for Zope. ;-)
The form will work with non-JS-Browsers too, only the confirmation won't, which is ok for this case. That's quite bad, IMHO. :-(
-- Sincerely yours, Bogdan M. Maryniuck "Linux: the operating system with a CLUE... Command Line User Environment". (seen in a posting in comp.software.testing)
participants (3)
-
Bo M. Maryniuck -
Stephan Goeldi -
Stephan Göldi