Hvis du mener at den valgte T-shirttype skal vises, så snart der klikkes på en Tshirt og brugeren derpå skal skrive direkte på T-shirten i stedet for et seperat felt kan du gøre sådan:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Vælg T-shirt type</title>
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Titel</title>
<style type="text/css">
#container{
position:relative;
height:297px;
width:269px;
background-image:url('standard_tshirt.jpg');
}
#mytxt{
position:absolute;
left: 79px;
top: 70px;
width: 96px;
height: 39px;
text-align:center;
overflow:hidden;
background:transparent;
border:0px;
}
</style>
<script type="text/javascript">
function dosome(){
var con = document.getElementById('container');
var elm = document.getElementById('mytxt');
var inp = document.forms[0];
// vælg fontstørrelse
elm.style.fontSize = inp.size.value;
// vælg skrifttype
elm.style.fontFamily = inp.stype.value;
//vælg farve
elm.style.color = inp.farve.value;
//hvis felt er afkrydset - fed skrift
if(inp.fed.checked==true){ elm.style.fontWeight = "bold"; }
else { elm.style.fontWeight = "normal"; }
elm.focus();
}
function empty(){ document.getElementById('mytxt').value = "";
}
function showit(pic){
document.forms[0].ttype.value=this.name;
document.getElementById('container').style.backgroundImage = "url(" + pic + ")";
dosome();
}
window.onload = dosome;
</script>
</head>
<body>
<!-- En container med den valgte T-shirt som baggrundsbillede -->
<div id="container">
<!-- En boks til teksten, der placeres så den passer over T-shirten -->
<input type="text" id="mytxt" size="20">
</div>
<br><br>
<form method="post" action="din_send_funktion.php" onreset="setTimeout('empty();dosome()',100);">
Vælg T-shirt type:
<span>
<img name="tshirt_" src="t1.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt1_" src="t1.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt2_" src="t2.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt3_" src="t3.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt4_" src="t4.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt5_" src="t5.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt6_" src="t6.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt7_" src="t7.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
<img name="tshirt8_" src="t8.jpg" onclick="showit(this.src)" style="cursor:pointer;" width="67" height="73">
</span>
<!-- hidden felt, hvor valget af t-shirttype gemmes og oplysningen kan senere sendes -->
<input name="ttype" value="tshirt_" type="hidden">
<br>
Skrifttype:
<select size="1" name="stype" onchange="dosome()">
<option value="Times New Roman">Rimes New Roman</option>
<option value="Arial Black">Arial Black</option>
<option value="Comic Sans MS">Comic Sans</option>
</select><br>
Tekststørrelse:
<select size="1" name="size" onchange="dosome()">
<option value="14px">str 1</option>
<option value="16px">str 2</option>
<option value="20px">str 3</option>
<option value="24px">str 4</option>
<option value="28px">str 5</option>
<option value="30px">str 6</option>
</select><br>
Farve:
<select size="1" name="farve" onchange="dosome()">
<option value="black">sort</option>
<option value="white">hvid</option>
<option value="green">grøn</option>
<option value="red">rød</option>
<option value="blue">blå</option>
</select><br>
Fed:
<input type="checkbox" name="fed" onclick="dosome()" value="ON"><br>
<br>
<input type="reset" value="nulstil"> <input type="submit" value="Bestil T-shirt">
</form>
</body>
</html>
NB: denne løsning kræver skrifttyper, som brugeren må formodes også at have på sin maskine !
...problemet med programmering er, at man ALTID kan tænke videre ;o)
/psc