-
1. Re: Fields visibility driven by a calculated field
try67 Jan 10, 2012 5:50 AM (in response to enrico68)You need to drop the quotes around the numbers. These are actual numbers,
not strings.
Also, you might want to explicitly convert the value of the field you're
checking into a number, like so (notice the plus sign):
var aTOTCHK = +this.getField("TOTCHK").value;
-
2. Re: Fields visibility driven by a calculated field
enrico68 Jan 11, 2012 2:36 AM (in response to enrico68)Hi try67,
I tried but it's still not working. And I have to modify the previous posting: anytime is NOT working (always the "else" condition is taken). Any other idea?
// Verify Check
var aTOTCHK = +this.getField("TOTCHK").value;if(aTOTCHK > 999)
{this.getField("SignatureCheckedBy1").display = display.visible;
this.getField("SignatureCheckedBy2").display = display.visible;
this.getField("SignatureCheckedBy3").display = display.visible;
this.getField("SignatureCheckedBy4").display = display.visible;
this.getField("SignatureCheckedBy5").display = display.visible;
this.getField("SignatureCheckedBy6").display = display.visible;
this.getField("SignatureCheckedBy7").display = display.visible;}
else if(aTOTCHK > 99)
{this.getField("SignatureApprovedBy").display = display.visible;}
else if(aTOTCHK > 9)
{this.getField("SignatureAgreedBy1").display = display.visible;
this.getField("SignatureAgreedBy2").display = display.visible;
this.getField("SignatureAgreedBy3").display = display.visible;
this.getField("SignatureAgreedBy4").display = display.visible;
this.getField("SignatureAgreedBy5").display = display.visible;
this.getField("SignatureAgreedBy6").display = display.visible;
this.getField("SignatureAgreedBy7").display = display.visible;}
else if(aTOTCHK > 0)
{this.getField("SignatureAuthorizedBy").display = display.visible;}
else{this.getField("SignatureArchivedBy").display = display.visible;} -
3. Re: Fields visibility driven by a calculated field
try67 Jan 11, 2012 3:06 AM (in response to enrico68)First of all, you need to hide the fields. I suggest you first hide them all, and then run this code. Otherwise once a field has been set to visible, it will remain so.
Also, do you have any error messages in the console?
-
4. Re: Fields visibility driven by a calculated field
enrico68 Jan 11, 2012 3:25 AM (in response to enrico68)The signature fields are all hidden and the script should make visible the correct ones depending on the value. No indications are in the JS debugger consolle while filling the form. This is the only message
Acrobat EScript Built-in Functions Version 10.0
Acrobat SOAP 10.0
I don't know if it's important: I'm using AcrobatX Pro
-
5. Re: Fields visibility driven by a calculated field
try67 Jan 11, 2012 3:41 AM (in response to enrico68)From which event are you launching this code?
-
6. Re: Fields visibility driven by a calculated field
enrico68 Jan 11, 2012 5:05 AM (in response to try67)Sorry try67, I made a beginner error ..... The name of the field was mistyped (due to the initial creation of "multiple fields"). ("TOTCHK" was typed as "TOTCHK.0") :-(
With Your suggestion about the format now is all working
Thank You for the support


