Additional asp scripting help

Discussion in 'ASP General' started by freemann, May 30, 2006.

  1. freemann

    freemann Guest

    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
    freemann, May 30, 2006
    #1
    1. Advertising

  2. 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.
    Bob Barrows [MVP], May 30, 2006
    #2
    1. Advertising

  3. freemann

    freemann Guest

    "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.
    freemann, May 30, 2006
    #3
  4. 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.
    Bob Barrows [MVP], May 30, 2006
    #4
  5. freemann

    freemann Guest

    "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)%>
    freemann, May 30, 2006
    #5
  6. 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.
    Bob Barrows [MVP], May 30, 2006
    #6
  7. freemann

    freemann Guest

    "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,
    freemann, May 30, 2006
    #7
  8. 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.
    Bob Barrows [MVP], May 30, 2006
    #8
  9. freemann

    Mike Brind Guest

    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
    Mike Brind, May 30, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Reinmers

    Load additional dlls from asp.net page

    Stefan Reinmers, Jan 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    480
    Stefan Reinmers
    Jan 4, 2006
  2. Ron Stephens
    Replies:
    23
    Views:
    2,802
    Ron Stephens
    Apr 12, 2004
  3. DaveInSidney
    Replies:
    0
    Views:
    402
    DaveInSidney
    May 9, 2005
  4. Darren Blackley

    Help - Add additional meta tags using JS

    Darren Blackley, Aug 26, 2003, in forum: Javascript
    Replies:
    1
    Views:
    91
    Darren Blackley
    Aug 26, 2003
  5. Replies:
    3
    Views:
    113
    Danny
    Oct 14, 2006
Loading...

Share This Page