Newsgroup: it.comp.lang.javascript
Titolo: [info] come fare per non far ricaricare la pagina dopo il click del submit

vorrei che quando clicco sul pulsante di submit mi rimanga nella
pagina invece di ricaricarla
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<script language="javascript">
<!--
function calcola(){
var myArray = new Array(4);
myArray[0] = document.form1.campo1.value;
myArray[1] = document.form1.campo2.value;
myArray[2] = document.form1.campo3.value;
myArray[3] = document.form1.campo4.value;
myArray[4] = document.form1.campo5.value;  
var sum1 = 0;
var valore1 = document.form1.campo1.value;
  for (var i=0; i<myArray.length; i++)
	{
	   if(valore1 == myArray[i])
	   	{
		sum1 = sum1 + 1;
		}
    }
document.form1.campo1_val.value = valore1;
document.form1.campo1_rip.value = sum1;
}
//-->
</script>
<body>
  <table width="100%" border="0" cellspacing="5" cellpadding="5">
<form name="form1">
    <tr> 
      <td colspan="2"><div align="center">Colonna 1</div></td>
      <td width="21%">&nbsp;</td>
      <td width="59%">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input name="campo1" type="text" id="campo1" size="3"
maxlength="3">
        </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input name="campo2" type="text" id="campo2" size="3"
maxlength="3">
        </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input name="campo3" type="text" id="campo3" size="3"
maxlength="3">
        </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input name="campo4" type="text" id="campo4" size="3"
maxlength="3">
        </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input name="campo5" type="text" id="campo5" size="3"
maxlength="3">
        </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input type="submit" name="Submit" value="Calcola"
onClick="calcola();">
        </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td width="9%">valore: 
        <input name="campo1_val" type="text" value=" " size="3"
maxlength="3"> 
      </td>
      <td width="11%">ripetuto: 
        <input name="campo1_rip" type="text" value=" "  size="3"
maxlength="3"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>valore: 
        <input name="campo2_val" type="text" value=" " size="3"
maxlength="3"></td>
      <td>ripetuto: 
        <input name="campo2_rip" type="text" value=" " size="3"
maxlength="3"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>valore: 
        <input name="campo3_val" type="text" value=" " size="3"
maxlength="3"></td>
      <td>ripetuto: 
        <input name="campo3_rip" type="text" value=" " size="3"
maxlength="3"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>valore: 
        <input name="campo4_val" type="text" value=" " size="3"
maxlength="3"></td>
      <td>ripetuto: 
        <input name="campo4_rip" type="text" value=" " size="3"
maxlength="3"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td><div align="center">valore: 
          <input name="campo5_val" type="text" value=" " size="3"
maxlength="3">
        </div></td>
      <td>ripetuto: 
        <input name="campo5_rip" type="text" value=" " size="3"
maxlength="3"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
</form>
  </table>
</body>
</html>

 onClick="calcola();">
<input type="button" name="calcola" value="Calcola" onClick="calcola();" />
-- 
for (;;) artemis.alpeia();



ok