469,356 Members | 1,978 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

Additional asp scripting help

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
May 30 '06 #1
8 1119
freemann wrote:
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

--
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.
May 30 '06 #2


"Bob Barrows [MVP]" wrote:
freemann wrote:
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

--
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.
May 30 '06 #3
freemann wrote:

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

??

--
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.
May 30 '06 #4


"Bob Barrows [MVP]" wrote:
freemann wrote:

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

??

--
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)%>
May 30 '06 #5
freemann wrote:
"Bob Barrows [MVP]" wrote:
freemann wrote:


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

??


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.

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

May 30 '06 #6


"Bob Barrows [MVP]" wrote:
freemann wrote:
"Bob Barrows [MVP]" wrote:
freemann wrote:
>
>
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

??


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.

--
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,
May 30 '06 #7
freemann wrote:
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
--
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.
May 30 '06 #8

freemann wrote:
"Bob Barrows [MVP]" wrote:
freemann wrote:
"Bob Barrows [MVP]" wrote:

> freemann wrote:
>>>
>>>
>> 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
>
> ??
>
>

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.

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


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.

--
Mike Brind

May 30 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by What-a-Tool | last post: by
7 posts views Thread by Scott M. | last post: by
17 posts views Thread by freemann | last post: by
3 posts views Thread by B | last post: by
6 posts views Thread by =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post: by
8 posts views Thread by Nagarajan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.