- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Greetings all,
I'm creating a pdf form using LiveCycle 8.0 that needs to hide or disable (either would be fine) a button when the pdf is first opened, depending on whether there is user-entered text present in a field on the form already. This would be due to users opening it, entering data in the text field, and then having saved it previously.
Here is the javascript that I have tried so far.
var k = form1.Table.subject.Paragraph.subject_name.rawValue;
if (k.length != 0){
form1.Button1.presence = "Hidden";
form1.Button1.access = "readOnly";
}
I've put the code into the 'docReady', 'form:ready' and 'layout:ready' events of my form, but when I open the form after saving some text in the text field, the button is still visible upon closing and re-opening the form.
The weird part is, if I set the 'Default' property of the text box to any non null value and test it in the Preview tab, it works!
It seems as though the Default property is set (and detected) by the events above before any user-entered (and previously saved) text is loaded into the text box fields on a form, so the events that I'm checking don't seem to be catching the user entered text at the point that they fire.
Basically, I'm asking how do I check for user-entered text (i.e. not part of the 'default' property of the text field) in a text field and then disable or hide a button on the form upon the pdf being opened?
What events should have my code in them?
If it is 'layout:ready', which one? The one for the form, the text field, or the button I want to hide?
Thanks in advance for all replies,
DJF
Solved! Go to Solution.
Views
Replies
Total Likes