Level 1
Level 2
Sign in to Community
Learn more
Sign in to view all badges
Expand my Community achievements bar.
This conversation has been locked due to inactivity. Please create a new post.
Good day all;
I am trying to figure out how to use a button instead of a checkbox to make a sub-form visible and when clicked again the sub-form will be hidden.
I have tried using an “if” statement but I do not seem to be able to get the logic right.
Any help would be appreciated.
The Chomp
Solved! Go to Solution.
Got it working......
This is what I did. If there is a better way of doing this, please let me know.
if (approval_note_subform.presence == "hidden") {
approval_note_subform.presence = "visible";
}
else if (approval_note_subform.presence == "visible") {
approval_note_subform.presence = "hidden";
View solution in original post
Hi,
Perfect way to do it. Only small suggestion would be that because the subform can only be visible OR hidden, you can drop the else if part:
if (approval_note_subform.presence == "hidden") { approval_note_subform.presence = "visible";}else { approval_note_subform.presence = "hidden";}
else {
Good luck,
Niall
Views
Likes
Replies