Having difficulty concealing a div once a specific condition is met. The condition depends on the user logging into a web application.
In my CSS file, I have set the multipleBox div to visibility: hidden, along with other styling attributes like border color.
Attempted using a function in Ajax to manipulate the display/visibility of the div based on the logged-in user. Unfortunately, it didn't work as expected.
Tried changing the div class using JavaScript as well, but no success there either.
The current function that's giving me trouble is triggered onload of the body:
function Hidder() { var valid = document.getElementById("form1:validate").value;
if (valid == true) {
document.getElementById("multipleBox").style.visibility ="visible";
}
}
Couldn't successfully toggle between visibility or display settings.
I aim for the div to remain hidden unless the user accessing the web app is an admin. I utilized JSF tags in my JSP page to fetch the user's credentials, storing the boolean value in the 'valid' variable.