473,778 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

style.display=' block' is not working

5 New Member
I have a hidden span within a table column and I cannot unhide it using style.display=' block' ??

Sample code
<table>
<tr>
<td><input name="status" value=""></td><td><input type="button" value="search" onClick="search ByStatus()"></td>
<td><div id="MySpan" Style="display: none"><img src="ajaxprogre ssindicator.gif "></div></td>
</tr>
</table>

var xmlHttp = new ActiveXObject(" MSXML2.XMLHTTP" );
function searchByStatus( ){
var f=document.form s[0];
var key =f.status.value ;
if(key==''){
alert("Please select a status");
return;
}
MySpan.style.di splay='block';
var url = "/"+document.form s[0].getdbpath.valu e+"/StatusSearch?Op enAgent";
pdata="&a="+key ;
xmlHttp.open("P OST",url,false) ;
xmlHttp.setRequ estHeader("Cont ent-type","applicat ion/x-www-form-urlencoded");
xmlHttp.setRequ estHeader("Cont ent-length",pdata.l ength);
xmlHttp.setRequ estHeader("Conn ection","close" );
xmlHttp.onready statechange = processSearchXM L
xmlHttp.send(pd ata)
}
I have used a similar method in the past. the location of the span, inside or outside of the table does not seem to matter.
I have got the image to appear by placing an alert after the line:
MySpan.style.di splay='block';.
Maybe this has something to do with a small result set, but in the past with only one result I still saw the image flicker and in this case I am returning over 25 results from the server.
May 25 '07 #1
3 23908
lilOlMe
74 New Member
I have a hidden span within a table column and I cannot unhide it using style.display=' block' ??
...
I have got the image to appear by placing an alert after the line:
MySpan.style.di splay='block';.
Maybe this has something to do with a small result set, but in the past with only one result I still saw the image flicker and in this case I am returning over 25 results from the server.

Have you tried :
Expand|Select|Wrap|Line Numbers
  1. document.getElementByID('MySpan').style.visibility = 'visible';
  2.  
or
Expand|Select|Wrap|Line Numbers
  1. document.getElementByID('MySpan').style.display = 'block';
  2.  
I think you need to use the getElementByID( ) method and set the style that way.

-LilOlMe
May 25 '07 #2
WSPL5
5 New Member
Yes, I tried document.getEle mentById('MySpa n').style.displ ay='block' as well as document.all['MySpan'].style.display= 'block';.
The way I call the span does not seem to have an effect.
May 25 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
If the result comes back very fast, is there a problem?

I think that you should use visibility instead so that the page layout doesn't change, but that depends on how the page is.
May 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1556
by: Harlan Messinger | last post by:
I thought I'd see what happened if I had a table used for layout with the class="flextable" and then defined .flextable td { display: block; } It "works" in current Windows-based browsers except IE--the cells appear top to bottom. In any event, I'm thinking this technique could be an expedient way to make existing table-based pages usable in narrow devices with the appropriate @media directive, or it could be offered to PC-based users...
7
4686
by: Jeff Thies | last post by:
I'm trying to do a nav list using list items. Roughly this is putting links styled display: block and with a background color. In IE5 (windows, haven't tried Mac yet), adding the display: block for the link adds a bit of whitespace between the list items. NS7.1 does not do this. Why the whitespace (about 5px)? Is it possible to get IE and NS looking
18
5632
by: David Morris | last post by:
G'day. Is there a known "display:block;" problem in opera? In playing around trying to get some cross browser conformance, I either inadvertently or redundantly (depending on your perspective) added "display:block;" to a style defining tables that also had zero padding, margin and border. With "xdisplay:block;" (that is nothing) all browsers (well Ie6, MZ, Ff Op in
2
1902
by: Richard | last post by:
When using display:block in a list array, is there a way to give a bit of seperation between the actual displays? ul {display:block;} ul li {display:block;} <ul> <li>item 1</> <li>item 2</li> <li>item 3</li>
7
5773
by: Marc | last post by:
Hi everyone. I am having trouble with a stylesheet in mozilla. It is part of turning a list into a menu: #menu li{ margin: 0; display: inline; vertical-align: bottom;
6
6201
by: Sandman | last post by:
I'm having some problem here... I have a javascript I've downloaded that goes through all PNG files and enables the transparency channel in them for IE5.5+ by converting them to SPAN layers with the image as background. This works great until I put one of these PNG files inside a display:none block and later sets the block to display:block - then the SPAN (that was the PNG <img>) remains hidden.
2
1237
by: dee | last post by:
Hi, How can you put 2 links in one line that use the style display:block? Thanks Dee
0
1387
by: Alan Silver | last post by:
Hello, I have noticed that setting "display:block" for a link causes IE5 to add a line break after the link. Is there a way to stop it doing this? IE6 and compliant browsers don't add the line break. If you look at http://www.kidsinaction.org.uk/fd3/060524.html in IE5 you'll see what I mean. TIA
3
11790
by: Chandra | last post by:
Hi All, I have 2 htmls with one being referred in iframe of the other. The iframe html has style display = block and none set in the javascript. however this makes the block go behind the parent html contents and not on top of it. Any idea how to resolve this? Thanks, Chandra
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10292
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.