Jeg er ikke sikker på om det er min PHP eller min javascript det er galt med, men tror det ligger i Javascriptet så derfor poster jeg denne her.
Jeg har en design selv side, hvor man kan "designe" sin egen folietekst.
Kan ses her:
http://www.atdesign-webshop.dk/streamer-folie.phpMit problem er at når man vælger Materiale til at starte med skal den vise de tilgængelige farver man kan vælge under Vælg farve sektionen, og det virker sådan set fint nok i firefox, men i internet explorer sker der umiddelbart et eller andet så den ikke viser farverne. Nogen der har nogle forslag om hvad det er internet explorer ikke forstår?
Jeg har klippet alt overflødig kode væk så i ser kun det der har med sagen at gøre, hvis i mener i har brug for at se mere så bare sig til, men er temmelig sikker på det er blandt disse koder problemet er.
Her er selve siden.
<script type="text/javascript">
function folie(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser understøtter ikke HTTP Request. Du kan desværre ikke bruge vores design selv side uden at opdatere din browser.");
return;
}
var url="library/streamer/folieType.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("color").innerHTML=xmlhttp.responseText;
antals=document.getElementById("qty").value;
countChange(antals);
}
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// kode for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// kode for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
</script>
<div class="t">1. Vælg materiale</div></div></div>
<select name="listMaterials" onchange="folie(this.value)">
<option selected="selected"></option>
<option value="Normal folie (Blank)">Normal Folie (Blank)</option>
<option value="Metal folie (Mat)">Metal folie (Mat)</option>
<option value="Metal folie (Blank - spejleffekt)">Metal folie (Blank - spejleffekt)</option>
<option value="Reflex folie">Reflex folie</option>
<option value="Glas effekt folie (Matteret/Sandblest)">Glas effekt folie (Matteret/Sandblæst)</option>
</select>
<div class="t">3. Vælg farve</div></div></div>
<table id="colorTable" border="0">
<tr>
<div id="color"></div>
</tr>
</table>
Så kommer folietype.php
<?php
require_once '../config.php';
require_once '../database.php';
$_SESSION['type']=$_GET["q"];
$_SESSION['size']=10;
$_SESSION['characters']=0;
if ($_SESSION['type'] == "Normal folie (Blank)")
{
echo '
<table>
<tr>
<td style="height: 20px; width: 20px;"><input name="hvid" value="255, 255, 255" id="hvid" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(255, 255, 255); color: rgb(255, 255, 255); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="sort" value="0, 0, 0" id="sort" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 0, 0); color: rgb(0, 0, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="morkGra" value="128, 128, 128" id="mørkGra" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(128, 128, 128); color: rgb(128, 128, 128); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="lysGra" value="239, 238, 238" id="lysGra" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(238, 238, 238); color: rgb(238, 238, 238); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="brun" value="139, 69, 19" id="brun" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(139, 69, 19); color: rgb(139, 69, 19); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="lysBrun" value="240, 230, 140" id="lysBrun" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(240, 230, 140); color: rgb(240, 230, 140); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="rod" value="221, 0, 0" id="rod" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(221, 0, 0); color: rgb(221, 0, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="pink" value="255, 0, 255" id="pink" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(255, 0, 255); color: rgb(255, 0, 255); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="orange" value="255, 153, 0" id="orange" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(255, 153, 0); color: rgb(255, 153, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="gylden" value="255, 215, 0" id="gylden" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(255, 215, 0); color: rgb(255, 215, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="morkGron" value="0, 100, 0" id="morkGron" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 100, 0); color: rgb(0, 100, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="gron" value="0, 170, 0" id="gron" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 170, 0); color: rgb(0, 170, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="lysGron" value="50, 205, 50" id="lysGron" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(50, 205, 50); color: rgb(50, 205, 50); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="stelBla" value="0, 0, 128" id="stelBla" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 0, 128); color: rgb(0, 0, 128); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="trafikBla" value="0, 0, 255" id="trafikBla" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 0, 255); color: rgb(0, 0, 255); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="isBla" value="173, 216, 230" id="isBla" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(173, 216, 230); color: rgb(173, 216, 230); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="violet" value="186, 85, 211" id="violet" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(186, 85, 211); color: rgb(186, 85, 211); height: 25px; width: 25px; cursor: pointer;" type="submit"></td
</tr>
</table>';
}
if ($_SESSION['type'] == "Metal folie (Mat)")
{
echo '
<table>
<tr>
<td style="height: 20px; width: 20px;" border="1"><input name="solvmetal" value="204, 204, 204" id="guldmetal" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(204, 204, 204); color: rgb(204, 204, 204); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="guldmetal" value="204, 170, 0" id="guldmetal" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(204, 170, 0); color: rgb(204, 170, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="kobbermetal" value="204, 85, 17" id="kobbermetal" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(204, 85, 17); color: rgb(204, 85, 17); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
</tr>
</table>';
}
if ($_SESSION['type'] == "Metal folie (Blank - spejleffekt)")
{
echo '
<table>
<tr>
<td style="height: 20px; width: 20px;"><input name="spejlsolv" value="221, 221, 221" id="spejlsolv" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(221, 221, 221); color: rgb(221, 221, 221); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="spejlguld" value="221, 187, 0" id="spejlguld" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(221, 187, 0); color: rgb(221, 187, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
</tr>
</table>';
}
if ($_SESSION['type'] == "Reflex folie")
{
echo '
<table>
<tr>
<td style="height: 20px; width: 20px;"><input name="rodrefleks" value="254, 0, 0" id="rodrefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(254, 0, 0); color: rgb(254, 0, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="blarefleks" value="0, 0, 254" id="blarefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 0, 254); color: rgb(0, 0, 254); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="hvidrefleks" value="254, 254, 254" id="hvidrefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(254, 254, 254); color: rgb(254, 254, 254); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="gulrefleks" value="255, 255, 0" id="gulrefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(255, 255, 0); color: rgb(255, 255, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="orangerefleks" value="254, 101, 0" id="orangerefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(254, 101, 0); color: rgb(254, 101, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="gronrefleks" value="0, 102, 0" id="gronrefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 102, 0); color: rgb(0, 102, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="sortrefleks" value="0, 0, 0" id="sortrefleks" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(0, 0, 0); color: rgb(0, 0, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
</tr>
</table>';
}
if ($_SESSION['type'] == "Glas effekt folie (Matteret/Sandblest)")
{
echo '
<table>
<tr>
<td style="height: 20px; width: 20px;"><input name="glassolv" value="221, 221, 221" id="glassolv" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(221, 221, 221); color: rgb(221, 221, 221); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
<td style="height: 20px; width: 20px;"><input name="glasguld" value="221, 187, 0" id="glasguld" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(221, 187, 0); color: rgb(221, 187, 0); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
</tr>
</table>';
}
?>
En anden ting der måske er værd at nævne er hvis du tager den sætning fra php scriptet der bliver genereret(uanset hvilken):
<td style="height: 20px; width: 20px;"><input name="hvid" value="255, 255, 255" id="hvid" onfocus="colorChange(this.value)" style="border-style: 1; background-color: rgb(255, 255, 255); color: rgb(255, 255, 255); height: 25px; width: 25px; cursor: pointer;" type="submit"></td>
Og sætter dette ind i et html dokument bliver boksen vist så det er ikke det internet explorer ikke kan finde ud af. Det er derved jeg er kommet frem til fejlen må ligge i scriptet et eller andet sted.
Indlæg senest redigeret d. 29.06.2009 13:17 af Bruger #15117