How do I set up a button so the first time it is clicked it shows a hidden subform, but then when it is clicked again, it hides the subform?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Here is something similar. Instead of looping through images, it would change the presence.
It is based on having a global variable in the File / Form Properties / Variable tab called vCounter. It would look something like this in the click event:
switch (vCounter.value)
{
case "1":
subform1.presence = "visible";
vCounter.value = "2";
break;
case "2":
subform1.presence = "hidden";
vCounter.value = "1"; // changes counter back to 1
break;
}
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
Here is something similar. Instead of looping through images, it would change the presence.
It is based on having a global variable in the File / Form Properties / Variable tab called vCounter. It would look something like this in the click event:
switch (vCounter.value)
{
case "1":
subform1.presence = "visible";
vCounter.value = "2";
break;
case "2":
subform1.presence = "hidden";
vCounter.value = "1"; // changes counter back to 1
break;
}
Hope that helps,
Niall
Views
Replies
Total Likes
On the Click event for the button you can do the following (javascript):
switch (Subform1.presence) {
case "hidden":
Subform1.presence = "visible";
break;
case "visible":
Subform1.presence = "hidden";
break;
}
Thanks!
I also found this solution:
if (xfa.form.assessment.Interaction.presence == "visible") {
Views
Replies
Total Likes
Jono's solution is much nicer, as it doesn't need the global variable at all!!
N.
Views
Replies
Total Likes
I like to keep it simple!
Views
Replies
Total Likes