Originariamente inviato da var
la funzione corretta sarebbe questa:

codice:
<script language="JavaScript">
function guarda()
{
alert(document.nomeform.cognome.value);
}
</script>
ciao
Ho fatto diversi tentativi anche usando la sintassi giusta ma è lo stesso... ti posto parte del codice dello script (parte in php)
codice:
<?
echo "
<html>
<head>
<title>Inserimento dati agenzia</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>

<body bgcolor=\"#ffffff\" text=\"#000000\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">


<form action=\"addoff.php\" method=\"post\" enctype=\"multipart/form-data\">
<table name=\"tabella\" width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:5px\" align=\"center\">
  
  <tr> 
    <td align=\"center\" style=\"font-size:14;color:#000000;font-weight:bold;font-weight:bold\" colspan=\"2\">INSERIMENTO OFFERTA</td>
  </tr>
   
   <tr> 
    <td width=\"80\" style=\"font-size:11\">Agenzia</td>
    <td width=\"500\">
	<input type=\"hidden\" name=\"nome\" value='$codice'>
      <input disabled type=\"text\" name=\"nomedisabled\" style=\"border-color:#ffffff;height:18;width:404;font-size:10px\" value='$codice'>
    </td>
  </tr>
  
  <tr> 
    <td width=\"80\" style=\"font-size:11\">Offerta di</td>
    <td width=\"500\" style=\"font-size:11\" valign=middle> 
      <select name=\"tipofferta\" style=\"font-weight:bold;color:#000000;background-color:#ffffff;font-size:11;height:20;width:75\">
	  <option>Affitto</option>
	  <option>Vendita</option>
	  </select>
		Città
      <select name=\"citta\" style=\"font-weight:bold;color:#000000;background-color:#ffffff;font-size:11;height:20;width:140\">
		$elenco_citta
	  </select>
	  Zona
	  <input type=\"text\" name=\"zona\" style=\"border-color:#ffffff;height:18;width:76;font-size:10px\">
      <input type=\"button\" value=\"...\" style=\"font-weight:bold;color:#FFFFFF;background-color:#000000;font-size:11;height:20;width:20\">
   </td>
  </tr>
  
  <tr> 
    <td width=\"80\" style=\"font-size:11\">Tipologia</td>
    <td width=\"500\" style=\"font-size:10\"> 
      <select name=\"tipoimm\" style=\"font-weight:bold;color:#000000;background-color:#ffffff;font-size:11;height:20;width:250\">
	  $elenco_tipologie
	  </select>
	  Mq
      <input type=\"text\" name=\"mqimm\" style=\"border-color:#ffffff;height:18;width:30;font-size:10px\"  onBlur='numerico(this)'>
      Vani
      <input type=\"text\" name=\"vani\" style=\"border-color:#ffffff;height:18;width:40;font-size:10px\"  onBlur='numerico(this)'>
	 </td>
  </tr>
  
  <tr> 
    <td width=\"80\" style=\"font-size:11\">Mq giardino</td>
    <td width=\"500\"  style=\"font-size:11\"> 
		<input type=\"text\" name=\"mqgiardino\" style=\"border-color:#ffffff;height:18;width:30;font-size:10px\"  onBlur='numerico(this)'>
		Mq garage
		<input type=\"text\" name=\"mqgarage\" style=\"border-color:#ffffff;height:18;width:30;font-size:10px\"  onBlur='numerico(this)'>
		Mq cantina
		<input type=\"text\" name=\"mqcantina\" style=\"border-color:#ffffff;height:18;width:30;font-size:10px\"  onBlur='numerico(this)'>
  </tr>
  
  <tr> 
    <td width=\"80\" style=\"font-size:11\">Descrizione</td>
    <td width=\"500\" style=\"font-size:11\"> 
      <textarea name=\"descrizione\" multiline rows=\"5\" cols=\"50\" style=\"border-color:#ffffff;height:100;width:404;font-size:12px\"></textarea>
    </td>
  </tr>
  
  <tr> 
    <td width=\"80\" style=\"font-size:11\">Prezzo</td>
    <td width=\"500\" style=\"font-size:11\"> 
		<input type=\"text\" name=\"prezzo\" style=\"border-color:#ffffff;height:18;width:60;font-size:10px\" onblur='numerico(this)'>
    </td>
  </tr>
  

  <tr> 
    <td width=\"80\" style=\"font-size:11;\">Periodi</td>
    <td width=\"500\" style=\"font-size:11\"> 
      <select name=\"periodi\" style=\"font-weight:bold;color:#000000;background-color:#ffffff;font-size:11;height:20;width:250\">
	  $elenco_tipologie
	  </select>

  </td>
  </tr>



   <tr>
    <td width=\"579\" style=\"font-size:11\" align=\"center\" colspan=\"2\">
      

	  <input type=\"submit\" value=\"Conferma\" style=\"font-weight:bold;color:#FFFFFF;background-color:#000000;font-size:11;height:20;width:60\">
      <input type=\"button\" value=\"Annulla\" style=\"font-weight:bold;color:#FFFFFF;background-color:#000000;font-size:11;height:20;width:60\" onclick=\"window.close()\">
    </td>
  </tr>
</table>


</form>
</body>
</html>";
?>
<script language="javascript1.2">
<!--
-->
</script>
Ad ultimo mettevo le funzioni (ora le ho tolte ed ho messo tutto nel click del pulsante "Aggiungi")

Così funziona ma se metto la funzione non và