how do I take an object from hidden to visible (screen only) is there code for this?
Views
Replies
Total Likes
You have to set the presence property. For example,
form1.page1.subform1.name.presence = "hidden";
form1.page1.subform1.name.presence = "visible";
If you have a form with a text field called 'name' and a button called 'visibilityBtn' with a caption of 'Hide', you could attach the following script to the click event of the button to toggle the visibility of the text field from visible to hidden.
// form1.page1.subform1.visibilityBtn::click - (JavaScript, client)
var status = xfa.resolveNode("form1.page1.subform1.visibilityBtn.caption.value.#text").value;
if (status == "Hide") {
form1.page1.subform1.name.presence = "hidden";
xfa.resolveNode("form1.page1.subform1.visibilityBtn.caption.value.#text").value = "Show";
}
else {
form1.page1.subform1.name.presence = "visible";
xfa.resolveNode("form1.page1.subform1.visibilityBtn.caption.value.#text").value = "Hide";
}
Note - the most common mistake when it comes to dynamic form behaviour is to forget to save the form as a dynamic PDF form.
Steve
Views
Replies
Total Likes
Steve,
I see what your saying but I need to make it screen only visible so it will not print,
So would that be form1.page1.subform1.name.presence = "print";?
Views
Replies
Total Likes
Sorry. Try setting the relevant property on the applicable objects to "-print" on the prePrint event. For example,
// form1.page1.subform1.table_.row_[0].date::prePrint - (JavaScript, client)
this.relevant = "-print";
Views
Replies
Total Likes