Additional asp scripting help

F

freemann

Wow, this has been some trip. I'm learning some asp scripting to apply toward
some online forms and they are working really good.

However I do have this one problem that I can't seem to get to work right.
There are two radio buttons to choose from, one for individual,value is $25
and the other for couple, value is $35. I am passing the dollar amount to
several different webpages but having trouble bringing over the category
(individual or couple) as comments. This is what I have so far:

dim comments
if amount = $25 then
comments = individual
else
comments = couple
end if

The amount is dimmed as well. This of course is not working and any help
would be greatly appreciated.

Thanks,
NF
 
B

Bob Barrows [MVP]

freemann said:
Wow, this has been some trip. I'm learning some asp scripting to
apply toward some online forms and they are working really good.

However I do have this one problem that I can't seem to get to work
right. There are two radio buttons to choose from, one for
individual,value is $25 and the other for couple, value is $35. I am
passing the dollar amount to several different webpages but having
trouble bringing over the category (individual or couple) as
comments. This is what I have so far:

dim comments
if amount = $25 then
comments = individual
else
comments = couple
end if

The amount is dimmed as well. This of course is not working and any
help would be greatly appreciated.
You did not show how you set amount to a value. It's relevant. Show us.

Before you do, execute
response.write amount

to see if the result makes the problem clear to you. If not, show us the
result of thhe response.write statement as well.

Bob Barrows
 
F

freemann

Bob Barrows said:
You did not show how you set amount to a value. It's relevant. Show us.

Before you do, execute
response.write amount

to see if the result makes the problem clear to you. If not, show us the
result of thhe response.write statement as well.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
dim amount
amount = Request.Form("amount")

It all works fine without the if statement but I would really like to have
the comment category (individual or couple) to go along with the amount.

Thanks.
 
B

Bob Barrows [MVP]

freemann said:
dim amount
amount = Request.Form("amount")

It all works fine without the if statement but I would really like to
have the comment category (individual or couple) to go along with the
amount.

Thanks.

So where is the result of

response.write amount

??
 
F

freemann

Bob Barrows said:
So where is the result of

response.write amount

??

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

This is sending to a text file:
objTextStream.WriteLine amount

And this is sending to another webpage for processing:
<% InsertSignature(amount)%>
 
B

Bob Barrows [MVP]

freemann said:
This is sending to a text file:
objTextStream.WriteLine amount

And this is sending to another webpage for processing:
<% InsertSignature(amount)%>

I don't understand. What does this have to do with my request for you to
put a "response.write amount" statement into your page and run the page
to see what the amount variable contains? This is basic debugging, and
is necessary in this case if we are to have any chance of answering your
question.
 
F

freemann

Bob Barrows said:
I don't understand. What does this have to do with my request for you to
put a "response.write amount" statement into your page and run the page
to see what the amount variable contains? This is basic debugging, and
is necessary in this case if we are to have any chance of answering your
question.



--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
If I understand what you are saying, the amount variable contains nothing. I
am getting the amount for an input form which is then passed to a couple
other forms.

My main concern is how to apply an if then else statement in asp scripting.

Thanks,
 
B

Bob Barrows [MVP]

freemann said:
If I understand what you are saying, You don't. :)
the amount variable contains
nothing. I am getting the amount for an input form which is then
passed to a couple other forms.

Sigh. I need to know what amount contains _when the page is running!_
My main concern is how to apply an if then else statement in asp
scripting.
Which I cannot answer if I do not know the value contained in the amount
variable.

Look. Insert the response.write statement into the asp page. Save it.
Browse to the input form. Put some values in and submit it. Look at the
result of the response.write. Show me what it contains so I can help you
create the correct comparison in your if statement. I could make some
guesses, but I'd rather not waste my time and yours.

Bob Barrows
 
M

Mike Brind

freemann said:
If I understand what you are saying, the amount variable contains nothing. I
am getting the amount for an input form which is then passed to a couple
other forms.

My main concern is how to apply an if then else statement in asp scripting.

Your example is syntactically correct, so you know how to apply an
if...then...else statement. What your concern should be is to get it
to work correctly based on the values of the variables you are
comparing. You can't do that without checking the value of the
variables, and as Bob has pointed out in three posts up to now, the
only way to do that is to response.write the variables to the page at
appropriate intervals.

amount = Request.Form("amount")
response.write "Amount is " & amount

Is your form's method post or get? Also show the html for the radio
buttons - not the entire form.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top