preview av form
Vil gjerne av følgende kode skal skrive ut preview i bunnen av den eksisterende side i stedet for en helt ny side.<html>
<head>
<script language="JavaScript">
function preview(formelement)
{
document.write("<tr><td>Preview: ");
document.write(formelement.value);
document.write("</td></tr>");
}
</script>
</head>
<body>
<table width="100%" cellpadding="2" cellspacing="0">
<form method="get" action="index.php?op=2">
<tr>
<td align="left">Device Name:</td>
<td align="left" width="90%"><input type="text" name="name" size="50" maxlength="50" value="Device Name / Mask Id"></td>
</tr>
<tr>
<td align="left" colspan="2"><input type="button" value="preview" onClick="preview(this.form.name);"> <input type="submit" name="submit" value="submit"></td>
</tr>
</form>
</table>
</body>
</html>