I have a multipage form with 18 differant signature fields. I need to initialize the form with Page 1 hidden and then after signing a certain field, that page becomes visible. My code is as follows:
PostSign for field form1.RCP_Form_Page1.Block_28.Suppliers_Signature is:
form1.ProcurementLetter_Page1.presence = "visible"
Initialize on field form1.ProcurementLetter_Page1 is:
if (form1.RCP_Form_Page1.Block_28.Suppliers_Signature == null) then
form1.ProcurementLetter_Page1.presence = "hidden"
The above code works until you close and reopen the form. When reopening, it defaults back a null condition because null in this case doesn't work. I have even tried adding ".rawValue" at the end of "Suppliers_Signature" and that doesn't resolve it.
I think the root question is, how do I test the if statement to show a true condition of whether or not the signature field is signed?
Thanks for all that reply!
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").signatureValidate();
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.