Calculations on the fly?

I am new to ASP. I&#039;m trying to perform a very simple calculation inside my form tags. In addition to my other textfields, select boxes, etc., I have 3 additional text fields: Start time, end time, and result. I&#039;m trying to get the end time field to subtract the start time field to give me a result. <BR><BR>::HERE&#039;S THE TOUGH PART::<BR><BR>The result needs to be challenged:: <BR>If &#062;8 then result=1 <BR>If &#062;8 and &#060;23 then result=2<BR>If &#062;23 and &#060;58 then result=3<BR>If &#062;58 and &#060;63 then result=4<BR>If &#062;63 then resul=5<BR><BR>and for the kick in the pants: the result needs to be performed before the form is submitted.<BR><BR>Am I out of my mind? Do I need to pop-up a simple calculator? I&#039;m trying to idiot proof the text field...<BR><BR>Thanks for your help.