Views
Replies
Total Likes
this.mandatory = "error";
this.mandatoryMessage = "Must accept terms and conditions before submitting!";
if (CheckBox1.rawValue != "1")
{
xfa.host.messageBox("Terms and conditions must be accepted prior to submitting!");
}
else
{
EmailSubmitButton1.execEvent("click");
}
Views
Replies
Total Likes
Hi,
I used the script you provided in the above post, and it worked perfectly, but my situation is a little different: I have two checkboxes, but I only want the message to appear if one of them isn't selected. If the other checkbox is selected, I need the fake submit button to go ahead and generate the email to send the form. I'm new to LiveCycle Designer, and I'm unsure of how to correctly use the "if" and "else" javascript. I need the message to appear when clicking the WebExYes checkbox, but I don't want it to appear when the user clicks the IntercallCheckBox.
Here's what my script looks like so far:
if
(form1.subForm1.WebEx.WebExYes.rawValue != "1"){
xfa.host.messageBox("You must read the FHEG WebEx Usage Standards and select the Yes checkbox before submitting.");
}
else
{
SubmitButton.execEvent("click");
}
if
(form1.subForm1.AccountRequest.IntercallCheckBox.rawValue != "1")
else
{
SubmitButton.execEvent ("click");
}
Can someone tell me what I'm doing wrong or if I can even make this happen?
Thank you,
Hannah
Views
Replies
Total Likes
I figured it out (well, someone I work with who has javascript knowledge did ). Here's the script:
form1.subForm1.Button1::click - (JavaScript, client)
if
(form1.subForm1.AccountRequest.IntercallCheckBox.rawValue == "1") // 1 is checked 0 is not
{
SubmitButton.execEvent ("click");
}
else if (form1.subForm1.AccountRequest.WebExCheckBox.rawValue == "1")
{
if (form1.subForm1.WebEx.WebExYes.rawValue == "1")
{
SubmitButton.execEvent ("click");
}
else
{
xfa.host.messageBox("You must read the FHEG WebEx Usage Standards and select the Yes checkbox before submitting.");
}
}
else
{
xfa.host.messageBox("You must select one of the checkboxes before submitting.");
}
Views
Replies
Total Likes
I am sorry to say that i get the error message regardless if the check box is ticked or not
Any clues?
Paul
Views
Replies
Total Likes
I know this thread is old, but just for future visitors.....
If you want to require one of two checkboxes be marked before submitting, you can simplify the above with code like this in the "dummy" button. The "dummy" button should be visible, "Regular" control type, and contains the script. The "real" button is hidden, "Submit" control type, and has no script.
if ((checkBox1.rawValue == "1") || (checkBox2.rawValue == "1" )) {
SubmitButton_Real.execEvent ("click"); // the "real" button is the hidden one
}
else {
xfa.host.messageBox("Please check one of the above boxes.");
}
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
I'm having the same issue, I want to create the mandatory checkbox, and I've followed the instructions set forth but I'm so new to this that I'm having trouble. Is there a way I can e-mail my document to someone and have them take a look to see what I've done wrong? I'd appreciate any help I can get. Thank you.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies