Skip to main content
Inspiring
May 21, 2025
Answered

Lock/ Unlock Checkboxes Based on Signature Fields (signed/ unsigned)

  • May 21, 2025
  • 1 reply
  • 508 views

I have two signature fields: "CH Signature" and "BO Signature".

I have five other fields: "889 Check Box" , "Type Selection",  "Date1_af_date",  "Source Selection",  "Items Check Box",  

 

Starting point is:

  • "CH Signature" unsigned and unlocked
  • "889 Check Box" unlocked
  • "BO Signature" unsigned and locked
  • "Type Selection" unlocked
  • "Date1_af_date" unlocked
  • "Source Selection" unlocked
  • "Items Check Box" unlocked

 

1. When "CH Signature" is signed, two things should happen: 

a. Lock "889 Check Box"

b. Unlock "BO Signature"

 

Therefore, "CH Signature" runs the following code when signed:

this.getField("889 Check Box").readonly = true
this.getField("BO Signature").readonly = false

 

"CH Signature" has a Mouse Exit trigger set to always ensure that opposite happens when signature is cleared

if(getField("CH Signature").value == "")//CH sig not present
    {    
    getField("889 Check Box").readonly = false
    getField("BO Signature").readonly = true
}

 

2. Now that the "BO Signature" is unlocked, when it is signed, four things should happen:

a.  Lock these four fields: "Type Selection",  "Date1_af_date",  "Source Selection",  "Items Check Box"

 

Therefore, "BO Signature" runs the following code when signed:

this.getField("Date1_af_date").readonly = true
this.getField("Type Selection").readonly = true
this.getField("Items Check Box").readonly = true
this.getField("Source Selection").readonly = true

 

I have a Mouse Exit trigger set to always ensure that  opposite happens when the signature is cleared and to ensure that the "BO Signature" field is always locked when "CH Signature" is not signed and vis versa.

if(getField("BO Signature").value == "")//BO sig not present
    { 
    getField("Type Selection").readonly = false
    getField("Date1_af_date").readonly = false
    getField("Source Selection").readonly = false
    getField("Items Check Box").readonly = false
}

//this ensures that "BO Signature" field is always locked when "CH Signature" is not signed and vis versa
if(getField("CH Signature").value != "")//CH sig is present
    getField("BO Signature").readonly = false

else
    getField("BO Signature").readonly = true

 

If I follow the sequence below, it will return everything back to starting point:

  1.  Sign CH Signature
  2.  Sign BO Signature
  3.  Clear BO Signature
  4.  Clear CH Signature

 

However, I have encountered a weird problem where if I clear 4) the CH Signature BEFORE 3) the BO Signature, the four fields ("Type Selection",  "Date1_af_date",  "Source Selection",  "Items Check Box") will remain locked for some reason.  Only way to unlock them is to sign the CH Signature which will unlock BO Signature to where I can hover the mouse in and out of BO Signature field to trigger the mouse exit to unlock those four fields.

 

Need help figuring out why this is happening because I should be able to get back to the starting point no matter which sequence.

Correct answer try67

You really should be using a Calculation script for this. Using Mouse Exit is not reliable, because if the user doesn't interact with the field, it doesn't trigger. For example, if they clear the form. A calculation script will execute when the value of any field in the file is changed.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 21, 2025

You really should be using a Calculation script for this. Using Mouse Exit is not reliable, because if the user doesn't interact with the field, it doesn't trigger. For example, if they clear the form. A calculation script will execute when the value of any field in the file is changed.

MBChelsAuthor
Inspiring
May 22, 2025

10-4.  I put them in calculation scripts and they worked just fine like you said.  Thank you sir.

try67
Community Expert
Community Expert
May 22, 2025

Great!