Jump to content

How to hide the control using javascript wihtout affecting UI


sandeep_akhare
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...