473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

style.display='block' is not working

5
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="searchByStatus()"></td>
<td><div id="MySpan" Style="display:none"><img src="ajaxprogressindicator.gif"></div></td>
</tr>
</table>

var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
function searchByStatus(){
var f=document.forms[0];
var key =f.status.value;
if(key==''){
alert("Please select a status");
return;
}
MySpan.style.display='block';
var url = "/"+document.forms[0].getdbpath.value+"/StatusSearch?OpenAgent";
pdata="&a="+key;
xmlHttp.open("POST",url,false);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",pdata.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.onreadystatechange = processSearchXML
xmlHttp.send(pdata)
}
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.display='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 23807
lilOlMe
74
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.display='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
Yes, I tried document.getElementById('MySpan').style.display='b lock' 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 Expert Mod 8TB
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
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...
7
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:...
18
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)...
2
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...
7
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
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...
2
by: dee | last post by:
Hi, How can you put 2 links in one line that use the style display:block? Thanks Dee
0
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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,...
0
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...

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.