Using JavaScript Confirm Pop Up

crjunk

Member
I would like to write a JavaScript that will launch a confirmation widow asking the user if they want to process their record. If they click yes, then my Progress code runs. If they click no, then nothing happens.

First of all, is this possible? If so, can someone refer me to a sample of this type of script?

Thanks,
CR Junk
 

jongpau

Member
Depends.... is "the record" some data in a form or something?

Do not forget that JavaScript runs on the client and WebSpeed/Progress on the server so these are very much separated. Please explain yourself a little further and then maybe someone can help.
 

crjunk

Member
Sorry for the delay. I've been out of the office for a week due to power loss from Hurricane Katrina.

The record will already be loaded in the form. I have a "Process Record" button on the form that I would like to have run a Java Script that displays a confirm pop-up window asking the user "Are You Sure You Want to Process This Record?" . If they choose NO then nothing happens and the pop-up goes away. If they choose YES, then I would like to be able to run a couple of procedures that I've created in my CGI wrapper. These two procedures save any changes to the record and then creates an XML file that will be used to populate data in a Crystal Report.

I don't necessarily have to use a Java Script, I just need to somehow deliver a "Are You Sure..." message to the user so that they can back out of their action.

Thanks,
CR Junk
 

kirsch59

Member
Here's a snippet of HTML where a cgi-wrapper program (processform.r) posts when a button ("Process Record") is clicked and a JavaScript confirmation window's OK button is clicked:


<FORM NAME="xxx" ACTION="processform.r" METHOD="POST">

<INPUT TYPE="submit" VALUE="Process Record" onClick='return confirm("Are You Sure You Want to Process This Record?"'>

</FORM>


If the end user selects "Cancel" from the confirmation window, JavaScript returns a "false" and nothing is posted.
 

crjunk

Member
Thanks for your help. My problem is that I overlooked the obvious! I tried to make thing more complicated than they were.

CR Junk
 
Top