Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 755
  • Last Modified:

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!
0
Cyber-Drugs
Asked:
Cyber-Drugs
  • 4
1 Solution
 
ZylochCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now