[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

textbox visible from JavaScript

Posted on 2006-11-21
6
Medium Priority
?
5,494 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 1500 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

830 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