Display property error

Hi guys,

I'm working on adding a feature to hide rows of a table in one of my web applications, and get this error on page load:

Error: Could not get display property. Invalid argument.

this is my function:

function InspectorShowHide(displaySetting) {
      document.getElementById("insRowinspectorID").style.display = displaySetting;
      document.getElementById("insRowinspectorWidth").style.display = displaySetting;
      document.getElementById("insRowinspectorHeight").style.display = displaySetting;
      document.getElementById("insRowinspectorLatitude").style.display = displaySetting;
      document.getElementById("insRowinspectorLongitude").style.display = displaySetting;
      document.getElementById("insRowinspectorZIndex").style.display = displaySetting;
}

and it is being called on the:

<body onload="InsectorShowHide('hide');">

Any ideas how to get past this error?


Cheers!
LVL 4
Cyber-DrugsAsked:
Who is Participating?
 
ZylochConnect With a Mentor Commented:
Hi Cyber-Drugs,

It is:

display:none
visibility:hidden

;-)

Regards,
Ted
0
 
Cyber-DrugsAuthor Commented:
I am really not with it today am I? Lol, thanks again Ted!
0
 
ZylochCommented:
Cyber-Drugs,

In fact, to toggle, you would do:

InspectorShowHide('none');

and

InspectorShowHide('');

assuming of course InspectorShowHide is spelled correctly.

Ted
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
ZylochCommented:
Cyber-Drugs,

No problem, it's just one of those days, eh?

Ted
0
 
MorcalavinCommented:
Use 'none' instead of 'hide'
'block' will make the elements visible again,
'inline' will also make them visisble, but in a different manner.
0
 
ZylochCommented:
Yep, exactly, and there are other ones too, such as inline-block and table, for instance. Setting it to blank will revert the object to its default display setting, be it block, inline, or table, etc.

Ted
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.