Read Only

17 views
Skip to first unread message
Assigned to solomo...@clarke.k12.ga.us by me

Edward Mcallister

unread,
Sep 22, 2020, 8:38:32 AM9/22/20
to livecycle


I am a little stuck on a problem. I have a repeatable table using the addInstance and when the form is completed it needs to be saved. In that save button I also want to change the repeatable table to be read only. This works for the first table but all subsequent additions are open access. Can anyone point me in the right direction?

Thanks

Ed

Adam D.

unread,
Sep 22, 2020, 10:58:58 AM9/22/20
to live...@googlegroups.com
hey Ed. so for saving form just reader extend it for save rights. you can use a script on button click that can lock the fields. i can send you the button code and sample later.

Adam



- Adam
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/livecycle/CAN9JiwCn%3DBbv8iaA25K2sX5P7gB8H07AW1xnyF%3Do2hK7Q206sQ%40mail.gmail.com.

Edward Mcallister

unread,
Sep 22, 2020, 11:17:32 AM9/22/20
to livecycle
Thanks Adam,

I do extend it as I also have Acrobat Pro and I use .access="readOnly" to lock the fields, but it only locks the first set, not the additions. Looking forward to seeing the script.

Thanks

Ed

fred.pantalone

unread,
Sep 23, 2020, 10:36:20 AM9/23/20
to Adobe LiveCycle Developers
Hey Ed,

Make the containing subform read only and all of its children will also be read only.

Fred

Edward Mcallister

unread,
Sep 24, 2020, 7:37:23 AM9/24/20
to livecycle


Many thanks.

Kind regards

Ed

adamjoel79

unread,
Sep 25, 2020, 12:07:38 AM9/25/20
to live...@googlegroups.com
Ed, use the below script on the click event on a button (in LiveCycle - Javascript) and it should do the trick. sorry it took a while to get back to you, very busy with work. Let me know if it works!

- Adam



function lockFields(oNode) {  
     if (oNode.className === "field" || oNode.className === "subform") {  
          if (oNode.access != "protected") {  
               oNode.access = "protected";  
            }  
          if (oNode.className === "field" && oNode.ui) {  
               if (oNode.ui.oneOfChild.className === "button") {  
                    oNode.presence = "invisible";  
               }  
          }  
     }  
     for (var i = 0; i < oNode.nodes.length; i += 1) {  
         lockFields(oNode.nodes.item(i));  
     }  
  };  
   
lockFields(xfa.form);

Edward Mcallister

unread,
Sep 28, 2020, 4:16:43 AM9/28/20
to livecycle
Thanks Adam, this is brilliant.

Kind regards

Ed

Reply all
Reply to author
Forward
0 new messages