Hi all. I have, from an online RPG application (very old and not maintened indeed -- so be warned, there are a lot of code "donts" inside here) which uses the file I'm posting to submit a text; what I want is the text field called "Messaggio" to be cleared after the form is processed. The very strange thing is the error which is given in the Safari Console: at the second line of the last <script> (document.input.Messaggio.value=''), I get a "Type error: undefined value". Am I doing something notably wrong, apart the uglyness of the code I inherited?
Thanks for any help.
Thanks for any help.
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
BODY {font-size:10px; text-decoration: none; font-family:verdana; font-weight:normal;}
TD {font-size:10px; text-decoration: none; font-family:verdana; font-weight:normal;}
TABLE {font-size:10px; text-decoration: none; font-family:verdana; font-weight:normal;}
input, textarea, select {
color:bba67a;
background-color: #000000;
font-family:Verdana;
font-size:10px;
border-right: 1px solid #bba67a;
border-bottom: 1px solid #bba67a;
border-left:1px solid #bba67a;
border-top:1px solid #bba67a;
}
</style>
<link href="temi/default/mainchat.css" rel="stylesheet" type="text/css"></head>
<SCRIPT TYPE="text/javascript">
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'height=400,width=280,scrollbars=yes');
return false;
}
</SCRIPT>
<body topmargin=0 leftmargin=0 bgcolor=#000000>
<table cellpadding=0 cellspacing=0 border=0 align=center width="500">
<tr>
<td align=center colspan=6>
<!--
<table align="center" valign="top" width="70%">
<tr>
<td align="center" valign="top">
-->
<img src="divisoria.gif">
<img src="divisoria.gif">
<img src="divisoria.gif">
<!--
</td>
</tr>
</table>
-->
</td>
</tr>
<tr>
<td align=center>Locazione
</td>
<td align=left>Testo
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<form name=invio action="input.php" method=POST>
<td valign=middle cellspacing=1>
<input type=Text Name=Locazione class=txtbox size=15 style="font-weight:normal;font-family:Verdana;font-size:8pt" maxlength="2000" value="area">
</td>
<td valign=middle>
<input type=Text Name=Messaggio class=txtbox size=60 style="font-weight:normal;font-family:Verdana;font-size:8pt" maxlength="2000" value="">
</td>
<td valign=middle>
<input type="submit" value="Invia" title="Invia" class="submit">
</td>
</form>
<form name=invio action="input.php?mod=sus" method=POST>
<td valign=middle align=left>
<input type="submit" value="Sussurra.." title="Sussurri" class="submit">
</td>
</form>
<form name=invio action="input.php?mod=dadi" method=POST>
<td valign=middle align=left>
<input type="submit" value="Oracolo" title="Tira dadi" class="submit">
</td>
</form>
<!-- </form> -->
<SCRIPT TYPE="Text/Javascript">
document.invio.Messaggio.value=''
document.invio.Messaggio.focus()
</SCRIPT>
</tr>
</table>
</body>
</html>