Solved

textbox visible from JavaScript

Posted on 2006-11-21
6
5,473 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

18 Experts available now in Live!

Get 1:1 Help Now