script i rammer
Hej eksperterJeg har et script, et onscreen tastatur, hvorfra man kan udfylde et søgefelt. Det fungerer ganske fint. Dog kunne jeg godt tænke mig, at scriptet kunne befinde sig i én ramme (frame) og søgefeltet i en anden. Er det muligt?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>lme3</title>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<p align="center"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:Barmeno Bold;font-size:small;}
#tastatur td{padding:10px;font-size:15pt;border:0px;width:1em;text-align:center;cursor:pointer;}
</style>
<script language="javascript" type="text/javascript">
var taster = new Array();
taster[0] = ['1','2','3','4','5'];
taster[1] = ['6','7','8','9','0'];
window.onload = function(){
var t = document.getElementById('tastatur'),newTr,newTd,newTxt;
var newTable = document.createElement('table');
t.appendChild(newTable);
var newTbody = document.createElement('tbody');
newTable.appendChild(newTbody);
for(i=0;taster.length>i;i++){
newTr = document.createElement('tr');
newTbody.appendChild(newTr);
for(j=0;taster[i].length>j;j++){
newTd = document.createElement('td');
newTr.appendChild(newTd);
newTxt = document.createTextNode(taster[i][j]);
newTd.appendChild(newTxt);
newTd.onclick = function(){addText(this);};
}
}
}
function addText(elm){
var ta = document.getElementById('year');
ta.value += elm.firstChild.nodeValue;
}
</script>
<title>lme3</title>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div id="tastatur">
<p align="center"></div>
</body>
</html>
</body>
</html>
