textbox visible from JavaScript

Posted on 2006-11-21
Last Modified: 2008-01-09
Dear Experts
i am using ASP.NET2.0 C# JavaScript

i have a textbox i want to know if it is visible or not from JavaScript.
it is very urgent

thank you
Question by:RamyBouchra
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
LVL 23

Expert Comment

ID: 17988242
Depends on how it may be being set to invisible.

If you hide it by doing "TextBox.Visible = False" in your code-behind, then the control will not be found by your clientside javascript so you can check using something like:
if (document.all.TextBox)
    // Textbox is present

Or, if you hide it using styles (e.g. style="display:none"), then you can check by:
if ('none')
    // Textbox is invisible
LVL 11

Accepted Solution

ethoths earned 500 total points
ID: 17988709
Addendum to adathelad's answer. In addition to display you can also use the visibility style...

Or, if you hide it using styles (e.g. style="visibility:hidden"), then you can check by:
if ('hidden')
    // Textbox is invisible

Author Comment

ID: 17989636
yes i did use this TextBox.Visible = False.
so how can i solve this problem
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now


Author Comment

ID: 17989640
it is urgent

Author Comment

ID: 17989688
i am thinking of something
how to make this style "style.visibility=='hidden'" from C#
 pleaae help.

Author Comment

ID: 17991981
i Did it
if it just
like that
if (document.getElementById('<%=inputOpenPopup.ClientID%>') == null)
not Exsists
it is Exsists

thank you

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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