Greetings all,
First time poster, sooooo glad I found this forum. Anyway, I'm creating a pdf form using LiveCycle 8.0 that needs to hide or disable a button, when the pdf is first opened, depending on whether there is 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 saving 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 text in a textfield and then disable or hide a button on the form upon the pdf being opened?
What events should have my code in them?
Thanks in advance for all replies,
DJF
If it's on opening, I use on 'Initialize'
xfa.event="true"
xfa.form.form1.subform.brmselect.presence="invisible";
If it's on some sort of entry or change, I use on 'Change'
xfa.event="true"
xfa.form.form1.subform.brmselect.presence="invisible";
Works for me!
A poor overworked muppet