Copy link to clipboard
Copied
Hi,
I have my client who wants to have a workflow where if person A fills up section A, he will check on the checkbox and only Section A would be read-only. Then he sends it to person B and fills up section B and similarly check on a different checkbox and section B is read-only as shown in the image.

Any thoughts on this?
Thanks with regards,
James
Copy link to clipboard
Copied
You can use the following code as the MouseUp event of the field, then:
this.getField("FieldA").readonly = true;
this.getField("FieldB").readonly = true;
this.getField("FieldC").readonly = true;
etc. (use the actual field names you want to "lock", of course).
And if you want to lock the check-box field itself then add it too to that list.
Copy link to clipboard
Copied
It's possible, but if you want it to really be secure use a digital signature instead of a check-box, and set it to lock those fields.
Copy link to clipboard
Copied
Hi try 67,
My clients prefer using a checkbox to lock the sections instead as he wants it simple rather than having a digital signature workflow.
Do you know how to lock the various sections and what is the code for that?
Thanks and regards,
James
Copy link to clipboard
Copied
Should the fields become "un-locked" if the box is "un-ticked"?
Copy link to clipboard
Copied
Hi try67,
Once the checkbox is checked and if person A already saves it, then the checkbox in Section A cannot be unchecked.
I hope that clarifies the situation.
Thanks with regards,
James
Copy link to clipboard
Copied
You can use the following code as the MouseUp event of the field, then:
this.getField("FieldA").readonly = true;
this.getField("FieldB").readonly = true;
this.getField("FieldC").readonly = true;
etc. (use the actual field names you want to "lock", of course).
And if you want to lock the check-box field itself then add it too to that list.
Copy link to clipboard
Copied
Hi try67,
Thanks for your help. Yes it works.
However, is it possible for me to disable the blinking text cursor in the text-fields even though you have set it to read-only? It's quite distracting.
Thanks with regards,
James
Copy link to clipboard
Copied
Not sure what you mean...
Copy link to clipboard
Copied
Hi try67,
Apologies if I didn't make myself clear.
If you observe the image I have attached,

Even though I have already set the respective fields to 'readonly', if a person clicks on the field again, there is a blinking cursor as shown. This might give a user the false impression that they can continue to input. Is there anyway of removing the blinking cursor?
Thanks with regards,
James
Copy link to clipboard
Copied
That doesn't happen when you use the Hand tool. Maybe you're using the Text Selection tool? If so, that can't be avoided. Even if you flatten the field the user will still be able to select the text using that too and place the cursor there. You can make it more clear that a field is not editable, though, but enabling the Fields Highlight color. It will be blue when the field can be edited and white when it's not.
Copy link to clipboard
Copied
Hi try67,
Yes. Indeed I have used the Text Selection Tool.
Looks like I need to convey to my clients to enable the Fields Highlight color to view the areas for input.
Anyway, thanks for your help!
Cheers!
James
Copy link to clipboard
Copied
You can switch to a other field with setFocus().
Copy link to clipboard
Copied
Hi Bernd,
Thanks for helping.
Is it possible to setFocus to nothing instead of switching to other fields? Care to give a sample code to illustrate this?
Thanks with regards,
James
Copy link to clipboard
Copied
setFocus to nothing is not possible.
Copy link to clipboard
Copied
Hi Bernd,
Thanks for helping anyway.
Cheers!
James
Copy link to clipboard
Copied
hii what should the code be if i want this condition?
Copy link to clipboard
Copied
fields become "un-locked" if the box is "un-ticked"
Copy link to clipboard
Copied
Replace true with false.
Copy link to clipboard
Copied
hi thank you for your reply! im actually trying to do something where when the checkbox is ticked all the fields are "locked" but when the checkbox is "unticked" fields 1-5 are "unlocked" but fields 5-10 are still "locked" because their trigger is a different checkbox. i hope this makes sense
Copy link to clipboard
Copied
What script do you use currently?
Copy link to clipboard
Copied
this script works okay for the locking part but im not sure what to do about the unlocking
this.getField("FieldA").readonly = true;
this.getField("FieldB").readonly = true;
this.getField("FieldC").readonly = true;
Copy link to clipboard
Copied
Use this, it will work if you manually uncheck checkbox if you use some other means to uncheck checkbox like script, mutually exclusive checkboxes or reset form you will have to use calculation script:
if(event.target.value !== "Off"){
this.getField("FieldA").readonly = true;
this.getField("FieldB").readonly = true;
this.getField("FieldC").readonly = true;}
else{
this.getField("FieldA").readonly = false;
this.getField("FieldB").readonly = false;
this.getField("FieldC").readonly = false;}
Copy link to clipboard
Copied
this works great! thank you so much!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more