Thanks for the example. This code works great for a button press but I can't get it to work with initialize.
I need to initialize the form with form1.ProcurementLetter_Page1.presence = "hidden" only when the signature field (form1.RCP_Form_Page1.Block_28.Suppliers_Signature) is unsigned. When the field is signed, I am going to use the PostSign event to trigger the appearance of this page. Unfortunetly, I can't get this to work using your code listed in your example. If I hide the page, I can get it to reappear after signature but when you close and reopen, the page is gone again. Here is the code I used:
var oState = event.target.getField("form1.RCP_Form_Page1.Block_29.Boeing_IPT_Signature").sign atureValidate();
if (oState == 0)
form1.InternalRoutingForm_Page2.presence = "hidden";
With this code, the form initializes showing the page "visible" instead of "hidden" even though the signature field is unsigned; which means the page should be hidden.
Thoughts? This must be possible as you can do it with other fields.
I could not get the initialize to work. So instead, I did the following:
Initialized the page to check to see if the signature title field was null. If it was null, I hid the page.
I then added a text field over the signature field that stated "You must fill out the title before the signature field will appear".
I initialized the signature to test the title field for null. If null, hide the signature and show the text. else, hide the text.
I then set a change formula to the title that said to hide the text field and show the signature field.
Last, I added textfield.mandatoryMessage on the signature field to display a message if the title was null.
This is not what I wanted but is a work around. The only issue is that I have two signatures and pages I want to do this too. They all work except the second page won't show the mandatoryMessage.
You could also try the docReady event, which is the last event to fire as the page renders. This may be better than the initialize event.
That worked! Thanks so much!!!!