Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two button form...

Status
Not open for further replies.

mjonson

Technical User
Mar 9, 2004
128
GB
can someone explain how i can make this work
on a form there are two buttons one does a calculation and displays a result the other goes to another page -

<form>
<input name="action" type="image" src="images/calcbut1_01.gif" width="108" height="50" border="0" value = "X">

<input name="action" type="image" src="images/tbot14_02.gif" width="75" height="50" border="0" value = "A">
</form>

'when the page is refreshed i want it to run this

a = Request.Form("action")
If (a = "" Or IsNull(a)) Then
a = "A" ' Copy record
Else
a = "X" ' Display 100
End If

Select Case a
Case "X":
purchtot = disc1 + 100
Case "A":
response.direct "main.asp"

'then this value is displayed?
<% response.Write purchtot %>
 
try:
response.write a

does it return both the values with a comma???

Known is handfull, Unknown is worldfull
 
hi vbkris,

thanks for yur help - hav got it goin

one thing i have this calculation

dim purchtot
purchtot = x_purch + x_disc1

but the result i get after a response.write
is the value of x_purch(10000) and value of x_disc1(100)
eg 10000100

is this because of the format of my input boxes?
how do change them to decimal (currency)
 
purchtot=cint(x_purch) + cint(x_disc1)

when u request a value it is always in string format...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top