hi folks
I have created a form in Adove livecycle es. Some fields should be read only from the start. So i have set the property .access 'open'. In versions of Adobe 8 this works, but in the latest version it won't so i think it should be done via another solution. Does anybody know how?
kind regards,
Anton Pierhagen
Solved! Go to Solution.
Views
Replies
Total Likes
May be the below code may help.. It loops thru all the pages in the PDF form and make them protected. So the user can not change any value in the form.
for (var i = 0; i < xfa.host.numPages; i++)
{
var oFields = xfa.layout.pageContent(i, "field");
var nodesLength = oFields.length;
//set the access type to be protected for all fields
for (var j = 0; j < nodesLength; j++)
{
var oItem = oFields.item(j);
oItem.access = "protected";
}
}
Thanks
Srini
Views
Replies
Total Likes
If you want to make the fields readonly you can use one of the below..
this.access = "readOnly";
this.access = "protected";
Thanks
Srini
Views
Replies
Total Likes
Hi
Thanks for your answer. But that's not what i am looking for. If you have a structure like:
subform
subform
field A
field B
subform
subform
field A
field B
And in your initialisation event of the data object you want to dynamicaly make sure everything is set on access 'read only'
What is a proper solution for that?
Views
Replies
Total Likes
subform1
subform2
field A
field B
subform3
subform4
field A
field B
If your structure looks like above then you can write code in any initialize event that subform1.access = "readOnly"; So it will make all the fields under subform1.
Or if you want make all the fields in subform1, subform2, subform3, subform4, then you need to set the presence property of the root subform, i.e. parent of the subform1.
Will this help..
Thanks
Srini
Views
Replies
Total Likes
I am looking for some code where you don't hard coded the name of the fields
like an for loop or something like that:
for example:
for(var count; count< object.nodes; count++)
{
if ( object.type == textfield)
object.access = "readOnly"
}
something like that. So that you set everything dynamically
Views
Replies
Total Likes
May be the below code may help.. It loops thru all the pages in the PDF form and make them protected. So the user can not change any value in the form.
for (var i = 0; i < xfa.host.numPages; i++)
{
var oFields = xfa.layout.pageContent(i, "field");
var nodesLength = oFields.length;
//set the access type to be protected for all fields
for (var j = 0; j < nodesLength; j++)
{
var oItem = oFields.item(j);
oItem.access = "protected";
}
}
Thanks
Srini
Views
Replies
Total Likes
Thanks for your answer!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies