Solved

Change the visibility of an HTML textbox.

Posted on 2011-09-18
7
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…
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…

732 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