Expand my Community achievements bar.

Copy down required attribute and color formatting in table

Avatar

Level 2

I have a table where the first two fields are required (not by the User Entered-Required value, but because of javascript on the signature field that checks certain fields before the form can be signed). They are also formatted to be red if there is no value in the field and white if there is a value in the field (javascript on the docReady, docClose and Exit events). This works perfectly if there is only one row. But once I add a row (instanceManager) the two fields are not checked for being required and are the "normal" looking text fields. How can I make sure that the required attribute and the color formatting are copied down to each row?

The script that I have on the docReady, docClose and Exit events for the color formatting is:

if ((this.rawValue == null) || (this.rawValue == ""))

     {

          this.fillColor = "255, 55, 55";

}else{

           this.fillColor = "255, 255, 255";

}

I have to do it this way because we need to form not to have any color on it when it is printed (like there is when you use the User Entered - Required value).

The script that I have to check fields for being required (on the Signature field Enter and Intitialize events)  is:

if ((cviPG1.certType.rawValue != null) && (cviPG1.certType.rawValue != "") &&

          (cviPG1.inspDate.rawValue != null) && (cviPG1.inspDate.rawValue != "") &&

          (cviPG1.consignor.fName.rawValue != null) && (cviPG1.consignor.fName.rawValue != "") &&

          (cviPG1.consignor.lName.rawValue != null) && (cviPG1.consignor.lName.rawValue != "") &&

          (cviPG1.consignor.address.rawValue != null) && (cviPG1.consignor.address.rawValue != "") &&

          (cviPG1.consignor.city.rawValue != null) && (cviPG1.consignor.city.rawValue != "") &&

          (cviPG1.consignor.zipCode.rawValue != null) && (cviPG1.consignor.zipCode.rawValue != "") &&

          (cviPG1.consignor.county.rawValue != null) && (cviPG1.consignor.county.rawValue != "") &&

          (cviPG1.consignor.phoneNum.rawValue != null) && (cviPG1.consignor.phoneNum.rawValue != "")&&

          (cviPG1.consignee.fName.rawValue != null) && (cviPG1.consignee.fName.rawValue != "") &&

          (cviPG1.consignee.lName.rawValue != null) && (cviPG1.consignee.lName.rawValue != "") &&

          (cviPG1.consignee.address.rawValue != null) && (cviPG1.consignee.address.rawValue != "") &&

          (cviPG1.consignee.city.rawValue != null) && (cviPG1.consignee.city.rawValue != "") &&

          (cviPG1.consignee.state.rawValue != null) && (cviPG1.consignee.state.rawValue != "") &&

          (cviPG1.consignee.zipCode.rawValue != null) && (cviPG1.consignee.zipCode.rawValue != "") &&

          (cviPG1.carrier.purpose.rawValue != null) && (cviPG1.carrier.purpose.rawValue != "") &&

          ((cviPG1.certType.rawValue == 1)&&((cviPG1.species.large.table.item.spp.rawValue != null) && (cviPG1.species.large.table.item.spp.rawValue != "")))&&

          ((cviPG1.certType.rawValue == 1)&&((cviPG1.species.large.table.item.headCt.rawValue != null) && (cviPG1.species.large.table.item.headCt.rawValue != "")))&&

          (vetCertification.certDate.rawValue != null) && (vetCertification.certDate.rawValue != "") &&

          (vetCertification.printedName.rawValue != null) && (vetCertification.printedName.rawValue != "") &&

          (vetCertification.certAddress.rawValue != null) && (vetCertification.certAddress.rawValue != "") &&

          (vetCertification.certCity.rawValue != null) && (vetCertification.certCity.rawValue != "") &&

          (vetCertification.phoneNum.rawValue != null) && (vetCertification.phoneNum.rawValue != "") &&

          (vetCertification.certState.rawValue != null) && (vetCertification.certState.rawValue != "") &&

          (vetCertification.certZip.rawValue != null) && (vetCertification.certZip.rawValue != "") &&

          (vetCertification.email.rawValue != null) && (vetCertification.email.rawValue != "") &&

          (vetCertification.usdaNumber.rawValue != null) && (vetCertification.usdaNumber.rawValue != "") &&

          (vetCertification.licenseState.rawValue != null) && (vetCertification.licenseState.rawValue != "") &&

          (vetCertification.licenseNumber.rawValue != null) && (vetCertification.licenseNumber.rawValue != ""))

{

          this.access="open";

}else{

            this.access="readOnly";

          app.alert("Please fill out all required fields in red");

}

The script in red pertains to the two fields that need to be required on every row. I tried adding [*] to the item but to no avail.

Any ideas?

Thanks!

0 Replies