Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 calculations
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

quince
Junior Member

Canada
103 Posts

Posted - 05 January 2005 :  13:27:25  Show Profile
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  Show Profile
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
Go to Top of Page

quince
Junior Member

Canada
103 Posts

Posted - 06 January 2005 :  00:26:28  Show Profile
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
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 06 January 2005 :  02:25:04  Show Profile
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
Go to Top of Page

quince
Junior Member

Canada
103 Posts

Posted - 06 January 2005 :  03:46:44  Show Profile
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???
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 06 January 2005 :  05:33:53  Show Profile
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07