PDA

View Full Version : Can't get ElementById to work!



paprbkwrtr
09-27-2005, 10:45 PM
I can't seem to get this Javascript to work:

<script type="text/javascript">
if (cfsc_user == true) {
document.getElementById("mf1").style.display="none";
}
else {
document.getElementById("mf1").style.display="block";
}
</script>

I am giving the tables Ids like <table id="mf1">. But for some reason it is not hiding the table from the cfsc users. It is still displaying. Just so you know, elsewhere on the page is a script that sniffs if the user is "cfsc" or not already. Do I still have to assign a function or variable to this? This is my first time coding to hide certain things from certain users so I am a bit confused on what the proper syntax is. I looked online before posting but couldn't find a proper example of what I am trying to do.

Can anybody hellp? Thanks.
Kevin

_Aerospace_Eng_
09-27-2005, 11:25 PM
Post the rest of your code please.

rm-f
09-28-2005, 01:44 AM
This is my first time coding to hide certain things from certain users

Be aware of security issue as JS is visible to ALL users.