Calculate Form

E

Evertjan.

Simon Gare wrote on 10 nov 2006 in
microsoft.public.inetserver.asp.general:
need to do a simple form calculation in asp based on values in 2 other
field and enter that data into table.

(field)SubTotal + (field)VAT = (Result in field)GrandTotal

========== test.asp ===========

<form method='post'>
<input name='subtotal'
value='<%= request.form("subtotal") %>'>
subtotal<br>
<input name='vat'
value='<%= request.form("subtotal") %>'>
vat in %<br>
<input type='submit' value='calculate'>
</form>

<table><tr>
<td>
GrandTotal:
<td>
<%= request.form("subtotal")*(1+request.form("vat")/100) %>
</table>

===============================
Any resources available

OK, please send € 1000.
 
E

Evertjan.

Evertjan. wrote on 10 nov 2006 in
microsoft.public.inetserver.asp.general:
Simon Gare wrote on 10 nov 2006 in
microsoft.public.inetserver.asp.general:


========== test.asp ===========

<form method='post'>
<input name='subtotal'
value='<%= request.form("subtotal") %>'>
subtotal<br>
<input name='vat'
value='<%= request.form("subtotal") %>'>

The above line should be:

value=' said:
vat in %<br>
<input type='submit' value='calculate'>
</form>

<table><tr>
<td>
GrandTotal:
<td>
<%= request.form("subtotal")*(1+request.form("vat")/100) %>
</table>

===============================


OK, please send € 1000.

€ 995.
 
S

Simon Gare

Thanks for that, like everything you never look for the easy route and have
been going round the houses for days!!

Thanks again.

Simon

PS No more than 750
 
E

Evertjan.

Simon Gare wrote on 11 nov 2006 in
microsoft.public.inetserver.asp.general:
Thanks for that, like everything you never look for the easy route and
have been going round the houses for days!!

In real live you should test serverside if the submitted value strings
can be converted to numbers or a nice error message should be generated.
PS No more than 750

751
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top