Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

validation of fields before emailing pdf

Avatar

Level 2

I have a form with a dropdown that when specific values are chosen from the dropdown they unhide certain fields.  Also, behind the submit button I have the following code.  The problem is that if the validation fails (for example if the dropdown value is "Claims" and none of the checkboxes are == 1, it puts the message box out there "Please select at least one LOB", but it immediately then opens the email box with the pdf attached.  I do not want it to allow anyone to go any further if they have not selected at least one checkbox.

Can anyone please help me clean up this non-working code below?  Thanks so much!

cbPIMSClaims.#subform[0].Button1::click - (JavaScript, client)

 

 

if

(ddl_PRM_Role.rawValue == "Underwriting")

if

(cbAltMktsUW.rawValue == 1 || cbAgriUW.rawValue == 1 || cbBondsUW.rawValue == 1 || cbEquineUW.rawValue == 1 || cbFidelityCrimeUW.rawValue == 1 || cbFISUW.rawValue == 1 || cbOMUW.rawValue == 1

||

cbPLLSIntUW.rawValue == 1 || cbPLLSUW.rawValue == 1 || cbPIMSUW.rawValue == 1 || cbSASUW.rawValue == 1 || cbSESUW.rawValue == 1 || cbSEandSUW.rawValue == 1 || cbSHSUW.rawValue == 1 || cbTruckingUW.rawValue == 1)

{

//xfa.host.messageBox("Atleast one checkbox is Checked");

EmailSubmitButton1.execEvent("click");

}

else

{

xfa.host.messageBox("Please select atleast one LOB");

}

if(ddl_PRM_Role.rawValue == "Claims")

if

(cbAltMktsClaims.rawValue == 1 || cbAgriClaims.rawValue == 1 || cbBondsClaims.rawValue == 1 || cbEquineClaims.rawValue == 1 || cbFidelityCrimeClaims.rawValue == 1 || cbFISClaims.rawValue == 1 || cbOMClaims.rawValue == 1

||

cbPLLSIntClaims.rawValue == 1 || cbPLLSClaims.rawValue == 1 || cbPIMSClaims.rawValue == 1 || cbSASClaims.rawValue == 1 || cbSESClaims.rawValue == 1 || cbSEandSClaims.rawValue == 1 || cbSHSClaims.rawValue == 1 || cbTruckingClaims.rawValue == 1)

{

//xfa.host.messageBox("Atleast one checkbox is Checked");

EmailSubmitButton1.execEvent("click");

}

else

{

xfa.host.messageBox("Please select atleast one LOB");

}

if

(ddl_PRM_Role.rawValue == "Agency Administration" || "IT Support" || "Billing" || "View Only" || "View Only-Tax ID" || "PRM TechSupport")

{

//xfa.host.messageBox("Agency Adm");

EmailSubmitButton1.execEvent("click");

}

else

xfa.host.messageBox("Please select a PRM Role");

 

 

0 Replies