Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Works in IE7 & FF but not in IE 6 after revamp

Status
Not open for further replies.

leeboycymru

Programmer
Jan 23, 2007
185
GB
I have been working on a site to make it compliant and to work more closely with css and div's.

Before I started work on it the area that Im going to ask about worked fine, but since I done some work on it, it doesnt work in IE6 which it did before, but it works fine in IE7 and FF.

I have posted the code that I think plays the part of the function.

This is the site im talking about:


and the area i cant get to work is the text area and drop down to the right of 'Hotel' in the central area of the website where the search is.

There is 2 layers there, and the one is supposed to sit above the aother until selected, so to cut it short the text entry field sits above the activities layer on first view, as you can see if you follow the original link.

And this is it working fine as it was before i worked on it.


Here is the code:

var country = new Array();
var region = new Array();
var countryregion = new Array();

function swap()
{
if (document.search.hlist.value ==0)
{
document.getElementById("services").style.display="none"
document.getElementById("hotname").style.display="block"
document.search.action="result.php";
}
else if(document.search.hlist.value ==1)
{
document.getElementById("hotname").style.display="none"
document.getElementById("services").style.display="block"
document.search.action="result.php";
}
}

function fillregion(countryid)
{
var i=0;
document.search.selectRegion.options.length=0;
if(countryid==0 || i==0 ){
document.search.selectRegion.options[0] = new Option()
document.search.selectRegion.options[0].value=0;
document.search.selectRegion.options[0].innerText="anywhere";
i++;
}

if(countryid!=0 && i!=0 ){
for(j=0;j<=countryregion.length;j++)
{
if(countryregion[j]==countryid)
{
document.search.selectRegion.options = new Option()
document.search.selectRegion.options.value=j;
document.search.selectRegion.options.innerText=region[j];
i++;
}
}
}
swap();
}

<select name="hlist" class="hlist" onchange="swap(this.value)">
<option value="0">Hotels</option>
<option value="1">Activities</option>
</select></td>
<td>
<div id="lhotname" style="position:absolute; left:155px; top:39px; width:112px; height:24px; z-index: 2; margin:0;"><input name="hotname" type="text" id="hotname" size="29" /></div>
<div id="lservices" style="position:absolute; left:155px; top:40px; width:112px; height:24px; z-index: 1; margin:0;">
<select name="services" id="services">
<?php
$qu=mysql_query("select * from tbl_tematics ") or die (mysql_error());
while($ru=mysql_fetch_assoc($qu))
{
echo "<option value='$ru[Id_Tem]'>$ru[Nom_Tem]</option>";
}
?>
</select>
</div>

So the trouble being that in the new update I cant get the z-index to work with the two layers.

Lee
 
I have been looking into it, and its nothing to do with the javascript functions, but its down to the layer bit as below:

<div id="lhotname" style="position:absolute; left:155px; top:39px; width:112px; height:24px; z-index: 2; margin:0;"><input name="hotname" type="text" id="hotname" size="29" /></div>
<div id="lservices" style="position:absolute; left:155px; top:40px; width:112px; height:24px; z-index: 1; margin:0;">

To check this I changed the z-index values around and the change worked in FF and stayed the same in IE6. But the problem is it works fine when in the old non compliant version, but for some reason doesnt work in IE6 in the compliant version, and that version works fine in IE7 and FF.


cheers

Lee
 
Whats difficult to understand with this, is that it used to work fine before moving over a compliant site, and it still works fine in IE7 and FF.

So have looked around a bit at other logs and it seems it might be that forms using z-index wont work using forms.

Has anybody found this before, and know of a way around my problem?

Lee
 
I have also read about adding blank iframes behind other divs to hide something from IE.

I read a bit and i got lost, is this an answer and if so can somebody explain it to me more please.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top