Hallo
Danke erstmal für die Antworten, das was hier mir geschrieben habt werde ich morgen ausprobieren, ich will ehrlich sein ich werde wohl jemanden fragen der mir den Code gibt sorry.
Aber nun habe ich schon wieder andere sorgen. Ich dachte der FF Browser wäre der empfindlichste, aber der stellt alles dar und der IE nicht??
Im FF wird unter Datum und Uhrzeit alles eingetragen nur im IE nicht.
Was ist das für ein Fehler?
<html>
<head>
<script type="text/javascript">
<!--
var i
var dat
var uhr
var beide
var iteration
var auswahl = new Array("text","text","text","text");
var breite = new Array("4","5","20","7");
var anzahl = new Array("2","5","5","20","11");
var buendig =new Array("rtl","rtl","","rtl");
var basis =new Array("oprn","persnr","maschine","datum","area");
function addRowToTable()
{
var tbl = document.getElementById('Tabelle');
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(-1);
var cell1 = row.insertCell(-1);
cell1.className = "cell02g";
var newText = document.createElement("input");
newText.type = "text";
newText.size = "1";
newText.align = "center";
newText.value = iteration;
newText.maxLength = 2;
newText.name = "pos" + iteration;
cell1.appendChild(newText);
for (i=0;i<basis.length;i++)
{
if(basis[i]=="area")
{
cell1 = row.insertCell(-1);
cell1.className = "cell02g";
textarea = document.createElement("TEXTAREA");
textarea.rows = "5";
textarea.cols = "25";
textarea.name = basis[i] + iteration;
cell1.appendChild(textarea);
}
else if(basis[i]=="maschine")
{
cell1 = row.insertCell(-1);
cell1.className = "cell02g";
afeld = document.createElement("SELECT");
newOption = document.createElement("OPTION");
newOption.text = "hallo";
cell1.appendChild(afeld);
afeld.appendChild(newOption);
}
else if(basis[i]=="datum")
{
cell1 = row.insertCell(-1); // hier eine Zelle erzeugt
cell1.align = "center"; // Elemente werde in der Zelle mittig gesetzt
cell1.className = "cell02g"; // der Zelle wird eine Klasse Zugewiesen
newText = document.createElement("input"); // ein Inputfeld wird erzeugt
newText.type = auswahl[i]; // hier wird dem Inputfeld der type zugewiesen in diesem fall über eine Variable
newText.size = breite[i]; // breite des Inputfeldes
newText.dir = buendig[i]; // ob die schrift rechts oder linksbündig ist
newText.maxLength = anzahl[i]; // wieviel zeichen das Inputfeld zulässt
newText.name = basis[i] + iteration; // der name plus ein Zähler wert
newText2 = document.createElement("input"); // ab ihr wird das zweite Inputfeld erzeugt (Datum und Uhrzeit)
newText2.type = auswahl[i];
newText2.size = breite[i];
newText2.dir = buendig[i];
newText2.maxLength = anzahl[i];
newText2.name = "zeit" + iteration;
var brObj = document.createElement('br'); // ein Zeilen Umbruch wird erstellt
cell1.appendChild(newText);
cell1.appendChild(brObj);
cell1.appendChild(newText2);
}
else
{
cell1 = row.insertCell(-1);
cell1.className = "cell02g";
newText = document.createElement("input");
newText.type = auswahl[i];
newText.size = breite[i];
newText.dir = buendig[i];
newText.maxLength = anzahl[i];
newText.name = basis[i] + iteration;
cell1.appendChild(newText);
}
}
Heute = new Date(); //Uhrzeit und Datum wird erstellt
Tag = Heute.getDate();
Monat = Heute.getMonth()+1;
Jahr = Heute.getFullYear();
dat = Tag + "." + Monat + "." + Jahr;
Heute = new Date();
Stunde = Heute.getHours();
Minute = Heute.getMinutes();
Sekunde = Heute.getSeconds();
uhr = Stunde + ":" + Minute;
//beide = dat +" "+"/"+" "+ uhr; // zum testen im Alert Fenster
document.getElementsByName("datum" + iteration)[0].value = dat;
document.getElementsByName("zeit" + iteration)[0].value = uhr;
}
//-->
</script>
</head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" media="all" />
<body >
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666">
<tr>
<td width="80"></td>
<td style="background-image:url(images/test.jpg)" align="left" height="70" valign="top" ><img src="images/head.gif" alt="" width="295" height="45"></td>
<td width="80"></td>
</tr>
<tr>
<td height="40"></td>
</tr>
</table>
<form name="form1" action="speichern.php" method="post">
<table width="650" border="0" align="center">
<tr class="cell02g">
<td class="style4" width="20">Kunde:</td>
<td><input size="35"></td>
<td class="style4">Zeichnungsnummer</td>
<td><input size="20"> </td>
</tr>
<tr class="cell02g">
<td class="style4">Bezeichnung:</td>
<td><input size="35"> </td>
<td class="style4">Protokollnummer</td>
<td><input size="20"> </td>
</tr>
<tr class="cell02g">
<td class="style4">Teilenummer:</td>
<td><input size="20"> </td>
<td class="style4">Progr.:</td>
<td><input size="20"> </td>
</tr>
</table>
<hr width="900" align="center">
<table id="Tabelle" width="650" cellpadding="2" border="1" align="center">
<tr class="style4">
<td align="center">Pos</td>
<td align="center">OP.Nr.</td>
<td align="center">Pers.Nr.</td>
<td align="center">Maschinen Nr.</td>
<td align="center">Datum &<br>Uhrzeit</td>
<td align="center">Text</td>
</tr>
</table>
<table width="705" border="0" align="center">
<tr>
<td align="right">
<form name="Formular" action="">
<input type="button" value=" + " onclick="addRowToTable()"><br>
<td><input type="submit" value="Speichern"></td>
</form>
</td>
</tr>
</table>
</form>
</body>
</html>