Ciao a tutti, ho provato ha realizzare un guestbook in jsp, e ho un problema lato client nella validazione, così mi rivolgo ai vari guri di questo forum. Non riesco ad accedere alla textarea in fase di validazione mentre riesco con i campi input text, non riesco a capire dove sbaglio: ecco il codice della mia paginetta HTML, grazie in anticipo a qualche anima buona:
<html>
<head>
<title>Guestbook</title>
<script language="JavaScript">
<!--
function valida()
{
var a = document.gbform.nick.value;
var b = document.gbform.testo.value;
if(a == "" | b == "")
{ win = window.open("Nuovapagina.html", "np", width="200", height="200");
return false;
win.focus();
}return true;
}
//-->
</script>
</head>
<body>
<form name="gbform" action="Guestbook6.jsp" method="post" onSubmit="return valida()">
<table style="z-index: 102; left: 25px; position: absolute; top: 116px">
<tr>
<td align="center" style="width: 150px; font-weight: bold;">
Nick:</td>
<td style="width: 129px">
<input name="nick" type="text" style="width: 188px; border-right: #FF4500 inset; border-top: #FF4500 inset; border-left: #FF4500 inset; border-bottom: #FF4500 inset;">
</td>
</tr>
<tr>
<td align="center" style="width: 150px; font-weight: bold;">
Email:</td>
<td style="width: 129px">
<input type="text" name="email" style="width: 188px; border-right: #FF4500 inset; border-top: #FF4500 inset; border-left: #FF4500 inset; border-bottom: #FF4500 inset;">
</td>
</tr>
<tr>
<td align="center" style="width: 150px; font-weight: bold;">
Locazione:</td>
<td style="width: 129px">
<input type="text" name="locazione" style="width: 188px; border-right: #FF4500 inset; border-top: #FF4500 inset; border-left: #FF4500 inset; border-bottom: #FF4500 inset;">
</td>
</tr>
<tr>
<td align="center" style="width: 150px; font-weight: bold;">
Testo:
</td>
<td style="width: 129px">
<textarea name="testo" rows="10" cols="20" style="border-right: #FF4500 inset; border-top: #FF4500 inset; border-left: #FF4500 inset; border-bottom: #FF4500 inset">
</textarea>
</td>
</tr>
<tr>
<td style="width: 150px">
</td>
<td style="width: 129px">
<input type="submit" value="invia" style="background-color: #FF4500; font-weight: bold; color: #ffffff;"><input type="reset" value="resetta" style="background-color: #FF4500; font-weight: bold; color: #ffffff;">
</td>
</tr>
</table>
</form>
</body>
</html>