Grazie ancora per la pazienza ho fatto come mi hai detto, un'unico campo (in realta' sono due ma viene stampato o uno o l'altro e comuque anche mettendo un solo campo non ricevo il suo valore) con un id unico ma non funziona, io posto tutta la pagina cosi' forse e' piu' facile vedere l'errore o il problema (Il campo che mi interessa testare e' TEMANU).
Ciao



Codice PHP:

<script language="Javascript" type="text/javascript">
[COLOR=orangered]function calcolacosti()
{
var inputField = document.getElementById('temanu').value;
inputField = inputField.trim(); // tolgo gli eventuali blank in testa e in coda
alert (inputField);
}[/COLOR] </script> 

</head>

<body style="overflow:auto" bgcolor="#ebf2f8">

<div style="width: 99%; height: 72%; border-size:2; overflow:auto; margin-left: 7px;
 border-width:thin; border-style:solid">
[COLOR=orangered]<form id="modulo" name="modulo" method="POST">
[/COLOR] 



<?php
$sql 
" SELECT * FROM PW_DAT.PRTE200F where TECLIE like '%$teclieelenco%' and TERAGS like '%$teragselenco%' and TEANNO <= $teannoelenco and TENRPR <= $tenrprelenco 
ORDER BY TEANNO DESC, TENRPR DESC FETCH FIRST "
.$cursor." ROWS ONLY FOR READ ONLY OPTIMIZE FOR 200 ROWS"

$stmt db2_exec($dbh$sql, array('cursor' => DB2_SCROLLABLE));
while (
$row db2_fetch_array($stmt)) 

if (!
$row=="") { 
    
$TEMANU $row[5]; 
    
$TEANNO $row[6]; 
......

if (
$contatore=='1'){?>
<td height="10"  bgcolor="#CCCCCC" align="left" width="40">
<input type="radio" id="user" name="user" value="<?php echo($contalink); ?>" />
<input type="hidden" name="teanno_<?php echo($contalink);?>" value="<?php echo($TEANNO);?>" />
<input type="hidden" name="tenrpr_<?php echo($contalink);?>" value="<?php echo($TENRPR);?>" />
<input type="hidden" name="temanu_<?php echo($contalink);?>" value="<?php echo($TEMANU);?>" />
<input type="hidden" name="temanu"  id="temanu"  value="<?php echo($TEMANU);?>"/>

<td width="4%" bgcolor="#CCCCCC" valign="top"><font face="Arial" size="2">
<a href="#"  onmouseover="ajax_showTooltip('ajaxtestatapreventivi.php?dati=<?php echo $dati?>',this);return false"  onmouseout="ajax_hideTooltip()">
<?php echo "$TEANNO"?>
</font>
</a>
</td> 
<td width="5%"  bgcolor="#CCCCCC"> <font face="Times New Roman" size="2"><?php echo "$TENRPR"?></font></td> 
<?php 

if (
$contatore=='2'){?>
<td height="10"  bgcolor="#F7F7F7" align="left" width="40">
<input type="radio" id="user" name="user" value="<?php echo($contalink); ?>" />
<input type="hidden" name="teanno_<?php echo($contalink);?>" value="<?php echo($TEANNO);?>" />
<input type="hidden" name="tenrpr_<?php echo($contalink);?>" value="<?php echo($TENRPR);?>" />
<input type="hidden" name="temanu_<?php echo($contalink);?>" value="<?php echo($TEMANU);?>" />
<input type="hidden" name="temanua" id="temanua"  value="<?php echo($TEMANU);?>"/>

<td width="4%" bgcolor="#F7F7F7" valign="top"><font face="Arial" size="2">
<a href="#"  onmouseover="ajax_showTooltip('ajaxtestatapreventivi.php?dati=<?php echo $dati?>',this);return false"  onmouseout="ajax_hideTooltip()">
<?php echo "$TEANNO"?>
</font>
</a>
</td> 
<td width="5%"  bgcolor="#F7F7F7"> <font face="Times New Roman" size="2"><?php echo "$TENRPR"?></font></td> 

<?php 
if (
$contatore=='1'){$contatore='2';}
else{
$contatore='1';}
$contalink $contalink+1
?>
</tr>
<?php 
 
} } ?>
</table>

</div>



<div align="center" style="margin-left: 7px">
[COLOR=orangered]
<input type="button"  value="Calc Sol+Costi" onClick="javascript:calcolacosti()"> [/COLOR]  
</div>

</form>
</body>
</html>