Solved

Change the visibility of an HTML textbox.

Posted on 2011-09-18
7
417 Views
Last Modified: 2012-05-12
I am able to hide a textbox by doing:
var tb1 = document.getElementById(id);
tb1.style.display = "none";

However, I am not able to make it visible by doing this:
tb1.style.display = "";

Please let me know what I could be missing. Thanks!
0
Comment
Question by:dshrenik
  • 4
  • 3
7 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 36557979
use : tb1.style.display = "block";
0
 

Author Comment

by:dshrenik
ID: 36557991
Still does not work. :(
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 36558010
if your textbox is set with : Visible="false"

<asp:Textbox runat="server" id="Texbox1" Visible="false" Text="blabla" />

the textbox DON'T EXIST in the page so you can ask javascript to show it

use :

<asp:Textbox runat="server" id="Texbox1" style="display:none"  Text="blabla" />
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 500 total points
ID: 36558012
another possible problem :

<div style="display:none">
<asp:Textbox runat="server" id="Texbox1" Text="blabla" />
</div>

you CAN'T SHOW it here too because the div around it is hidden
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36558032
<< the textbox DON'T EXIST in the page so you CAN'T ask javascript to show it >>
0
 

Author Comment

by:dshrenik
ID: 36558084
I am actually creating an HTML textbox through JavaScript.
0
 

Author Comment

by:dshrenik
ID: 36558093
I think the textbox is inside  a <td>, and I have set:
<td style="display: none">

Phew!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question