questa è la funzione:
codice:
function CheckSum(value1, value2)
{
  if(eval(value1 + value2) != 100)
  {
    alert('errore');
    return;
  }
  document.TuoForm.submit();
}
e questo è il bottone di che fa il submit:
codice:
<Input type=button value=submit onClick="Javascript:CheckSum(TuoForm.Campo1.value, TuoForm.Campo2.value);">