In the script below, everything works fine except when the first IF statement is true and the user clicks "Yes", the rest of the script (else if, etc...) does not fire. Originally I didn't have the section in red font but added it trying to solve this problem. Help would be appreciated...
Form1.Subform2.EmailButton::click - (JavaScript, client)
if (NoticeInfo.ExportClassification.rawValue == null || NoticeInfo.ExportClass.rawValue == null){
var nResponse = xfa.host.messageBox("You did not enter an export classification and/or select an export classification statement.\n\n Do you want to continue?", "Export Classification Blank", 1, 2);
if (nResponse == 3)
xfa.host.setFocus("NoticeInfo.ExportClassification");
if (nResponse == 4)
NoticeInfo.ExportClassification.rawValue == null;
}
else if (Subform3.NDAinPlace.rawValue !== "Yes"){
xfa.host.messageBox("The current NDA in place checkbox was left blank. Parts should not be sent to an external lab without current NDA in place.", "Current NDA in Place?", 0);
xfa.host.setFocus("Subform3.NDAinPlace");
}
else{
var vSubject = "External Lab Engineering Request";
var vBody = "Instructions:";
event.target.submitForm({cURL:"mailto:?" + "subject=" + vSubject + "&body=" + vBody,cSubmitAs:"PDF",cCharset:"utf-8"});
}
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
That is how the script is set up. Even without checking the response of the messageBox, you have three main if/else statements:
if (first test condition) {
messagebox script
}
else if (second test condition) {
another messageBox script
}
else {
submit form
}
So, if the first condition is met, the subsequent else if statement and the else statement will not fire.
You may want to move the email script into the if nResponse == 4 script.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
That is how the script is set up. Even without checking the response of the messageBox, you have three main if/else statements:
if (first test condition) {
messagebox script
}
else if (second test condition) {
another messageBox script
}
else {
submit form
}
So, if the first condition is met, the subsequent else if statement and the else statement will not fire.
You may want to move the email script into the if nResponse == 4 script.
Hope that helps,
Niall
Views
Replies
Total Likes
Yes - that does help. Thanks
-Don
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies