• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5499
  • Last Modified:

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
0
RamyBouchra
Asked:
RamyBouchra
  • 4
1 Solution
 
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
 
ethothsCommented:
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
 
RamyBouchraAuthor Commented:
yes i did use this TextBox.Visible = False.
so how can i solve this problem
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now