If you want to do it ~before~ submission, you'll need to use client-side
script to calculate the values, i.e. JavaScript, which is off-topic here of
course. But, as a sample:
<form name="formName">
<input name="a" type="text" onchange="hyp();" />
<input name="b" type="text" onchange="hyp();" />
<input name="c" type="text" />
</form>
<script type="text/javascript">
function hyp() {
var a = document.formName.a.value;
var b = document.formName.b.value;
if (a!='' && b!='') {
var c = Math.sqrt(Math.pow(a,2) + Math.pow(b,2));
if(!isNaN(c)) { document.formName.c.value=c; }
}
}
</script>
Ray at work
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
Hi,
I have a asp input form of a financial report. Here most of the fields are
text boxes where the user need to input the values corresponding to an
item. However, there are few items which are calcuated field. Prior to
submission of the information, I would like the user to know what the calculated
field be (based on the information input in text boxes) before submission of the
form. Is there any way to display the calculated value before submission
in ASP? I appreciate in any help. Thanks.