Author |
Topic |
|
quince
Junior Member
Canada
103 Posts |
Posted - 05 January 2005 : 13:27:25
|
well i had finished from one problem with the help of shaggy ... now i am facing another problem ...
i have a form and in this form i have a price .. what i want is to make a calculation to this price after pressing on a button for example i want to how is 15% from the price i have in the label ...
so how could i do this ...
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 05 January 2005 : 15:53:03
|
I did this for someone (on these forums) a long time ago, and all I did was called their price from the field in the form and sent it to the following format:FormatNumber(Request.Form("<field name>")*1.15,2) But if you show me the code where you want to display the code and from where the price is coming and I will place it in and show you like what Shaggy did in the other topic.
I hope that helps.. |
Cheers, David Greening |
|
|
quince
Junior Member
Canada
103 Posts |
Posted - 06 January 2005 : 00:26:28
|
thank you david for ur help ... here is the code
<input type="text" name="price" size="20"> <% FormatNumber(Request.Form("price")*1.15,2) %>
okay so how am i gonne display the answer on the screen
|
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 06 January 2005 : 02:25:04
|
If you put in the following: Response.Write "<% FormatNumber(Request.Form("price")*1.15,2) %>" In your page, it should show up.
|
Cheers, David Greening |
|
|
quince
Junior Member
Canada
103 Posts |
Posted - 06 January 2005 : 03:46:44
|
hey david i tried but it is not working, i will show you the code
<form> <input type="text" name="T1" size="20"> <% Response.write "FormatNumber(Request.Form("T1")*1.15,2)" %> </form>
i get an error it's telling me:
Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement /tri.asp, line 27, column 43 Response.write "FormatNumber(Request.Form("T1")*1.15,2)"
so what shell i do???
|
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 06 January 2005 : 05:33:53
|
Quince,
The code I gave to you is after they have submitted the form, if you want to grab a figure out of a DB then add the 15% on top of it, you need to do something different again. Can you e-mail me and I will e-mail you back and you can send me the form and I will out the code in and send it back. Try this first:<form>
<input type="text" name="T1" value="<% =FormatNumber(Request.Form("T1")*1.15,2) %>" size="20">
</fom> See if that helps, if not send me the e-mail and I will email you back and you can send the form over for me to get a better look at what you require.
|
Cheers, David Greening |
|
|
|
Topic |
|