Hi,
A pdf form has a dropdown field. The value is populated using a java program. The value can be anything. The dropdown should be readonly if the value populated is in the dropdown list else the user can select the value from dropdown list. How do I achieve this? Any help is greatly appreciated. Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Try this:
var vItems = this.length;
for (var i=0; i<vItems; i++) {
if (this.rawValue == this.getDisplayItem(i)) {
this.access = "readOnly";
}
}
Niall
Views
Replies
Total Likes
Hi,
I would generally use the exit event for something like this, but as the dropdon is populated from an external source you will need to use a different event. The change event may work, but I suspect that you may need to use the layout:ready event.
Something like this in JavaScript:
if (this.rawValue == "Yes") {
this.access = "readOnly";
}
else
{
this.access = "open";
}
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
How to check if the value is in the list of values for the dropdown? The code you have provided validates for a particular value but need to validate if that value is in the list. Thanks
Views
Replies
Total Likes
Hi,
Try this:
var vItems = this.length;
for (var i=0; i<vItems; i++) {
if (this.rawValue == this.getDisplayItem(i)) {
this.access = "readOnly";
}
}
Niall
Views
Replies
Total Likes
Hi,
It works like a charm. Is it possible to have a text and value for the dropdown list something like alias and will this code work in such a scenario? Also is it possible to share the list with other dropdown fields? Sorry if I am being very basic but I am very new to livecycle forms.
Views
Replies
Total Likes
No problem!
Yes in LC Designer you can select a dropdown and in the Object > Field palette set the Item Values. This is what the user sees when they interact with the dropdown.
Next go to the Object > Binding palette and tick the Specify values. Then you can set the values for each Item in the dropdown. These values can be numeric or a text string, or both.
See example here: http://assure.ly/fYCuQ2.
And then some more advanced ones: http://assure.ly/jtTkdO, http://assure.ly/jcTahK, http://assure.ly/mP5Lud.
Good luck,
Niall
Views
Replies
Total Likes
Hi,
I get 'The page cannot be found' error when I click on the links.
Views
Replies
Total Likes
Hi,
At the weekend we changed over to a new web server and the IP is still percolating through the net. The site is up, so if you search the code solutions for dropdown, you should find the examples: http://assuredynamics.com/.
The URLs should be back within 24 hours.
Niall
Views
Replies
Total Likes
Hi,
Thanks for the quick response.
Views
Replies
Total Likes
Views
Likes
Replies