Solved

textbox visible from JavaScript

Posted on 2006-11-21
6
5,475 Views
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
0
Comment
Question by:RamyBouchra
  • 4
6 Comments
 
LVL 23

Expert Comment

by:adathelad
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 (document.all.TextBox.style.display=='none')
{
    // Textbox is invisible
}
0
 
LVL 11

Accepted Solution

by:
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 (document.all.TextBox.style.visibility=='hidden')
{
    // Textbox is invisible
}
0
 

Author Comment

by:RamyBouchra
ID: 17989636
yes i did use this TextBox.Visible = False.
so how can i solve this problem
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:RamyBouchra
ID: 17989640
it is urgent
0
 

Author Comment

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

Author Comment

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

thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now