Jump to content

How to hide the control using javascript wihtout affecting UI


sandeep_akhare

Recommended Posts

Hi All I have 2 textboxes in a row i have need to show/hide them depending on radio button selection. i am able to hide the textbox controls using javascript but the problem that i am facing is -> When i am hiding the first textbox control second one is moving left i.e second textbox is displaying at the place of first textbox . can anyone please tell me how to hide the textbox control without dis placing the second one ? :)

Link to comment
Share on other sites

You can use the CSS 'visibility' property instead of the 'display' property, and then change that through Javascript, like this:

function show() {var obj = getElementById("YourElement");obj.style.visibility = "visible"}

You can change the 'visible' to 'hidden' to hide the box, of course. See CSS Visibility Property on W3schools.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...