473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Textbox Visibility

103 100+
Hi all,

I would like to know whether i can set the textbox visible(which is already invisible) using javascript.

I am using asp.net and c#.net.

Please help me.

regards,
Mathew
Oct 22 '07 #1
6 13979
iam_clint
1,208 Expert 1GB
yeah
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("id of the text box").style.visibility = "visible";
  2.  
or if your using display: none; then
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("id of the text box").style.display= "block";
  2.  
Oct 22 '07 #2
kunal pawar
297 100+
You can hide any control using Style property

For Hide :
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('control Id').style.display = 'hidden';
For Visible

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('control Id').style.display = 'none';
Oct 24 '07 #3
Ferris
101 100+
yeah
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("id of the text box").style.visibility = "visible";
  2.  
or if your using display: none; then
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("id of the text box").style.display= "block";
  2.  

I agree with this version.

by the way,if you use style.visibility ,the text box will remain in the place where it was,but you can't see it.and if you use style.display,the text box will be removed from the place (not from the web page.)

hope it helps.
Oct 24 '07 #4
acoder
16,027 Expert Mod 8TB
You can hide any control using Style property
For Hide :
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('control Id').style.display = 'hidden';
For Visible
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('control Id').style.display = 'none';
You've got the style.display and style.visibility properties mixed up. 'hidden' and 'visible' would be used with style.visibility (it should be 'none' and 'block' if you're using style.display).

In your code, the first line won't work. The second will actually hide the element.
Oct 24 '07 #5
kunal pawar
297 100+
for Hide control

document.getElementByID('Control Id').style.display="none";

For make visible
document.getElementByID('Control Id').style.display="";
Oct 24 '07 #6
iam_clint
1,208 Expert 1GB
your javascript would fail
This code won't work
Expand|Select|Wrap|Line Numbers
  1. document.getElementByID('Control Id').style.display=""; 
  2.  
This code will work
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('Control Id').style.display=""; 
  2.  


I would use a property here myself something such as inline or block..
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('Control Id').style.display="inline"; 
  2.  
Oct 24 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike | last post by:
Hello all, I have a form with a checkbox labeled other. I want to make it so if the user clicks "other" a textbox appears right next to it allowing them to fill in their value. If the other...
2
by: Bart Verbeke | last post by:
Hi, I have a form with 2 radio buttons (ACCEPT/REJECT). When the page is initially loaded, no textbox should be visible. When a user clicks the REJECT radio button, a textbox should...
5
by: chris | last post by:
i have a set od radio buttons what i wanty to do is when one particular button is selected bring up an additional text box for additional information how would i do this
10
by: Alex | last post by:
could someone please point me to a site with an explanation or give me a *very* simple example of a div that would open right below a textbox on a page. I've seen lots of examples out there....
3
by: Jason | last post by:
I am new to WebForms and am far more comfortable with WinForms. I am wondering how simple things such as showing/hiding a label and textbox can be accomplished if a certain Radiobutton option is...
7
by: Sandy | last post by:
Hello - I have a form that when submitted checks the database and if the username is already taken, a label shows indicating same. I need to make that label NOT visible after the user clicks...
0
by: Waran | last post by:
I need to create a Auto suggests Textboox like in http://www.google.com/webhp?complete=1&hl=en I have completed this using AJAX.NET for Framework 1.1 . I have some design issues after the data is...
13
by: WALDO | last post by:
I have a .Net TextBox (TextBoxBase, really) in which I am appending about 20 lines of text per second. I use the AppendText() method to accomplish this. This is a great substitute for taking the...
5
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a...
10
ammoos
by: ammoos | last post by:
Hi friends I am using the asp.net 2003 and I would like to change the visibility of a checkbox and textbox to “true” when I click on a radio button… I want to do this function by using JavaScript… ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.