Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"confirm" statement not working

Status
Not open for further replies.

PGMR1998

MIS
Apr 10, 2001
29
US
I cannot get the confirm to work. does anyone know why my confirm stmt will not work? Her is my code:

app.alert("Lets get started");

var answer = confirm ("Are you having fun?");
if (answer)
app.alert ("Woo Hoo! So am I.")
else
app.alert ("Darn. Well, keep trying then.");
if ( confirm("You have now successfully completed your application. Have you saved your completed application to your hard drive?"))
{app.alert ("You must now complete Step 2 by signing and dating the form. Fill in the appropriate information at the bottom and click the Save button. After saving the form to your harddrive, you must then email both completed forms as attachments to uSARR.GOV. You must then mail or email your transcripts as the final step.You will now be taken to the FCRA form automatically!")}
else {app.alert ("You cannot proceed until you have saved your completed application to your hard drive. It is necesary to save the application so that it can be sent as an attachment to our office.")} ;

app.alert("You have now successfully completed your application. You should now save it to your harddrive in completion of Step 1. You must now complete Step 2 by signing and dating the form. Fill in the appropriate information at the bottom and click the Save button. After saving the FCRA form to your harddrive, you must then email both completed forms as attachments to USARR.GOV. You must then mail or email your transcripts as the final step.You will now be taken to the FCRA form automatically!");
 
How does it not work? Does it generate an error? Is it not showing the dialog box? does it not display anything?

Elaborate so we may help you.

Also use [ignore]
Code:
[/ignore] tags to wrap your code so its a little more readable, and additionally try indention, and spacing its hard to read that code.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
My apologies! The code does nothing when it gets to the confirm. The first alert stmt comes up and after that all goes dead. No errors or anything.
This stmt works well:
app.alert("Lets get started");

But, after that - Nothing, not even an error...
 
There's nothing wrong with the confirm call, so I suspect something else is happening inside your "app" object when it calls the alert.

What browser are you using?
Can you use its error console to check for any possible errors?

FF, Chrome and even IE have ways of showing JS errors.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
I am using IE 7
The code is inside a pdf snippet. However, I placed the code in a new html doc and tried that new doc. But, the new doc does not work either and it is in an html doc with no other code. I suspect that confirm does not work in all environments... I will now try the error console. Any tips on using the console?
 
There's not much to the consoles. They just display the errors. its up to you to interpret and act accordingly.

As a test you could attempt to remove the app.alert call and see if that lets the confimr call through.

It maybe be an inability of the PDF to display a confirm. perhaps you need to use the pdf version as app.response instead.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Thanks for all your assistance. I have found the solution:
The "confirm" method does not work with pdf forms. When using pdf forms, you must use either the App.response or App.alert methods.

Example:
var result = app.alert({
cMsg: "Have you sent in your payments? This must be done before proceeding. ",
cTitle: "Your payments must be in!",
nIcon: 2,
nType: 2
});
//result = 3 means 'No' and result = 4 means 'Yes' was selected
if (result == 4)
{app.alert ("You must now complete Step 2.")
this.getURL(" false);
}
 
Exactly what I said.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top