Expand my Community achievements bar.

User Entry - Required on Hidden Sub-Form ?

Avatar

Level 2

Hi,

I have a drop down list with option 'YES' or 'No' if the user selects 'Yes' then another part of my form becomes visible and it is mandatory that the user completes the fields on this form.  If the user selects 'No' then they will never see the additional form and therefore they will not be required to complete the fields.

I have also added an actions which diplays a txt box warning the user that they must complete the additional form ( this displays if the user selects 'Yes').

I have inserted the script associated with the drop down menu below, can anyone explain to me what additional script I need to make the fields on my additional form mandatory when visible and optional or not mandatory when hidden and where I need to place this script?

Any help would be greatly appreciated I am really stuck with this one ?

  1. TopmostSubform.Page15.SC-DD::change - (JavaScript, client)

//+ GENERATED - DO NOT EDIT (ID:09B4122D-5F21-4FE4-8DD0-8972C135DD50 CRC:424323277)

//+ Type: Action

//+ Result1: ShowDialog("information","Applicant must complete 3 No. Certificates of Satisfactory Execution in relation to Site Clearance provided on the following pages.  (ASSESSMENT CRITERIA, Section 3.2 above for details).","CERTIFICATES REQUIRED")

//+ Node1: TopmostSubform[0].Page15[0].SC-DD[0]

//+ Condition1: ListField("$Node1","textselected","YES")

//+ ActionName: Text Message-SC

if ($.boundItem(xfa.event.newText) == "YES") {

  xfa.host.messageBox("Applicant must complete 3 No. Certificates of Satisfactory Execution in relation to Site Clearance provided on the following pages.  (ASSESSMENT CRITERIA, Section 3.2 above for details).", "CERTIFICATES REQUIRED", 3);

}

//-

//+ GENERATED - DO NOT EDIT (ID:CC4F7988-4B5F-43A7-A4CD-7DCBC9B3B70E CRC:1753812136)

//+ Type: Action

//+ Result1: SetPresence("$Node2","hidden")

//+ Node2: TopmostSubform[0].Cert-1[0]

//+ Node1: TopmostSubform[0].Page15[0].SC-DD[0]

//+ Condition1: ListField("$Node1","textselected","NO")

//+ ActionName: Site Clearance (N)

if ($.boundItem(xfa.event.newText) == "NO") {

  this.resolveNode("Cert-1").presence = "hidden";

}

//-

//+ GENERATED - DO NOT EDIT (ID:8A4A4A3A-4E7A-400E-B9AC-0FA42DB29826 CRC:3215569964)

//+ Type: Action

//+ Result1: SetPresence("$Node2","visible")

//+ Node2: TopmostSubform[0].Cert-1[0]

//+ Node1: TopmostSubform[0].Page15[0].SC-DD[0]

//+ Condition1: ListField("$Node1","textselected","YES")

//+ ActionName: Site Clearance (Y)

if ($.boundItem(xfa.event.newText) == "YES") {

  this.resolveNode("Cert-1").presence = "visible";

0 Replies