codice:
function controllo(f) {
 var somma=100;
 var v1=parseInt(f.c1.value);
 var v2=parseInt(f.c2.value);
 var v3=parseInt(f.c3.value);
 if (!(somma==(v1+v2+v3))) {
  alert("aarg!");
  return false;
 }
 return true;
}
da usare così:

codice:
<form onsubmit="return controllo(this);" name="ff">
ciao