By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,002 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,002 IT Pros & Developers. It's quick & easy.

Calculate Form

P: n/a
Hi all,

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

Any resources available

Thanks
--
Simon Gare
The Gare Group Limited

website: www.thegaregroup.co.uk
website: www.privatehiresolutions.co.uk
Nov 10 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 10 '06 #2

P: n/a
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:
>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") %>'>
The above line should be:

value='<%= request.form("vat") %>'>
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.
995.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 10 '06 #3

P: n/a
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

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
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:
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") %>'>

The above line should be:

value='<%= request.form("vat") %>'>
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.

? 995.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Nov 11 '06 #4

P: n/a
Simon Gare wrote on 11 nov 2006 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
>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:

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") %>'>

The above line should be:

value='<%= request.form("vat") %>'>
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.

? 995.
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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.