Announcement

Collapse
No announcement yet.

Simple to Add, Hard to Code. (webpages)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple to Add, Hard to Code. (webpages)

    I've got this programming problem. Let me break it down for you:

    I have a webpage. (It is an ASP page)

    This webpage has a form on it.

    This form has 3 different drop down menus.

    Each drop down menu has more than 1 item to select from.

    Each item has a different price.

    One of the drop down menu's is required to select.

    The submit button takes you to a confirmation page.

    The confirmation page shows you what you selected and gives you the total price of the items you selected.

    Here's the problem: How do I make the calculations work?
    be free

  • #2


    Tis the wizard who did the graphics!
    Long time member @ Apolyton
    Civilization player since the dawn of time

    Comment


    • #3
      Magic.

      Comment


      • #4
        In other words, I am more likely to know the answer than you two guys.
        be free

        Comment


        • #5
          Actually, since you already stated that you don't know, we are all equally likely to know, great one.

          Long time member @ Apolyton
          Civilization player since the dawn of time

          Comment


          • #6
            Check out the ASP forums:

            Founded in 1997, DEVShed is the perfect place for web developers to learn, share their work, and build upon the ideas of others.
            We the people are the rightful masters of both Congress and the courts, not to overthrow the Constitution but to overthrow the men who pervert the Constitution. - Abraham Lincoln

            Comment


            • #7
              Re: Simple to Add, Hard to Code. (webpages)

              Originally posted by Sn00py
              I've got this programming problem. Let me break it down for you:

              I have a webpage. (It is an ASP page)

              This webpage has a form on it.

              This form has 3 different drop down menus.

              Each drop down menu has more than 1 item to select from.

              Each item has a different price.

              One of the drop down menu's is required to select.

              The submit button takes you to a confirmation page.

              The confirmation page shows you what you selected and gives you the total price of the items you selected.

              Here's the problem: How do I make the calculations work?
              I don't know ASP, but what's so hard about that?
              Anyway I think you'll have to use JavaScript, because you wouldn't know which drop down box the user has selected when he selects items in more than one and then hits submit.
              So if he selects an item in one box you'll have to reset the other two boxes to some default value like "-- select --" or something like that.

              Ofc, you have a problem if someone hasn't activated JavaScript, but there is no easy way around this.

              Getting the value in ASP is a one liner I suppose. Ofc, you also need to do sanity checks, which makes it a 10 liner probably

              If you know nothing about ASP I suggest you read some tutorials or buy a book.

              Comment


              • #8
                I don't use ASP either, here's how it works in PHP.

                First, name all your menus. In fact, your safe bet is to name everything in (X)HTML with the name attribute. That way the values can get passed back in name-value pairs.Then all you need to do is to look into either the $_GET or $_POST for the values.
                (\__/) 07/07/1937 - Never forget
                (='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
                (")_(") "Starting the fire from within."

                Comment


                • #9
                  Thanks for the help.

                  I managed to get it going with javascript.

                  I am a graphic designer, not a programmer, but because of this job I have to be a programmer aswell!

                  The thing I really hate about coding is that when you figure out how to do it; it all makes logical sense. Not only that, but the answer is usually 10x smaller in size than what you originally tried out.
                  be free

                  Comment

                  Working...
                  X