Is there a way using javascript to change the display of a form after it as been rendered?

I won’t to remove a checkbox on a form if a certain condition is true.

Since this case is not the norm, the default rendering displays the checkbox even though it’s not a valid selection.

And the check I guess would have to come when the link to display the form is clicked.

Any ideas??


11 Years
Discussion Span
Last Post by Sailor_Jerry

you can use the style property 'display' to show/hide elements in your web page. Its pretty simple, if you give content that you want to manipulate an id:

// to hide
document.getElementById("yourDivOrElementId").style.display = 'none';

// to show
document.getElementById("yourDivOrElementId").style.display = 'block';

Thanks that worked for input element. Is there a way to hide elements that don't have an id? I have a label for the input element that looks like this

<label for"sameIDasInput">LableText</label>

I just put everything that needed to be modified on the fly between a div tag like so

<div ID="test0" style="visibility:visible">

With the visibility set.

I used javascript to update the visibility.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.