textbox visible from JavaScript

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
RamyBouchraAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ethothsConnect With a Mentor Commented:
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
 
adatheladCommented:
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
 
RamyBouchraAuthor Commented:
yes i did use this TextBox.Visible = False.
so how can i solve this problem
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
RamyBouchraAuthor Commented:
it is urgent
0
 
RamyBouchraAuthor Commented:
i am thinking of something
how to make this style "style.visibility=='hidden'" from C#
 pleaae help.
0
 
RamyBouchraAuthor Commented:
i Did it
if it just
like that
if (document.getElementById('<%=inputOpenPopup.ClientID%>') == null)
{
not Exsists
}
else
{
it is Exsists
}

thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.