Hello,

I'm attempting to create a page on my company website that lists products in my inventory. I've created asimple page, but need to create the scripting to make it do the following:

1. When the customer enters a quantity in the form field next to the part number(s), the quantity(s) and part number(s) they have chosen will then be moved to a new page when they click continue. This will be the page where they enter their contact information, etc...

2. I would like the second page to show the part numbers and quantities they requested from the previous page.

3. For phase one, all I want to have the form/page do upon clicking submit is to send the data (asp) to the server and then have an email sent to me with all the information. I will then reply to the customer with a quote. (I have some experience with submitting forms with ASP to a server, so I think I'm good here)

4. Phase two - I would like to have the server or javascript automatically quote the custmer upon clicking submit from the second page. Each part number is different and will have a different price. I would also like for them to be able to order the product at this point (credit card).

For many of you, I'm sure this is a very simple task. The question is...is it easy to explain how to do this? I know some basic Javascript from a class I took, but have lost a lot of the information, since it was two years ago.

Would anyone be willing to help me? I'm a one man electronic component distributor struggling to make ends meet. Can't afford to outsource this, but would be willing to pay a fair price for someone to guide me through the process. Thanks to anyone who can help.

H2ofield

Most of the time, complex multi-page tasks like this are accomplished with a server-side language, supported by a back-end database.

The applications are divided into 2 or 3 "levels" or tiers.

One tier would be the database. It would contain all of your products, organized properly, as well as all of the code to maintain the database and its integrity, commonly called the "CRUD" code: Create, Replace, Update, Delete.

Another tier would be what the user sees: the HTML, CSS, and JavaScript that controls the users' experience.

The middle tier holds all of your business logic. It would be written in PHP or ASP.NET - some server-side language. It responds to the users' actions, interacts with the database, and outputs the proper responses to the user.

All of that aside, some of what you ask can be accomplished with client-side code:

You wrote:

1. When the customer enters a quantity in the form field next to the part number(s), the quantity(s) and part number(s) they have chosen will then be moved to a new page when they click continue. This will be the page where they enter their contact information, etc...

You have two ways of passing data from one page to another. These methods are known as GET and POST. What you'll need is to write some JavaScript that handles the form's "submit" event. When the user submits the form, you will construct a GET querystring from the form data, and then use it to navigate to the new page.

A JavaScript on the new page will handle the page's "onload" event. In that code, you will parse the querystring and use it to populate the new page's form elements.

2. I would like the second page to show the part numbers and quantities they requested from the previous page.

The same thing. Items you need to research:

  • form "submit" method and event
  • page "onload" method and event
  • Querystring, "GET"
  • document.getElementById() method, to interact with specific form elements

3. For phase one, all I want to have the form/page do upon clicking submit is to send the data (asp) to the server and then have an email sent to me with all the information. I will then reply to the customer with a quote. (I have some experience with submitting forms with ASP to a server, so I think I'm good here)

Very good. In fact, you should consider using ASP for the entire application. Look at ASP's "Request" and "Response" objects.

4. Phase two - I would like to have the server or javascript automatically quote the custmer upon clicking submit from the second page. Each part number is different and will have a different price. I would also like for them to be able to order the product at this point (credit card).

Again, this is best handled server-side with the support of a database. In order to accurately generate a quote in JavaScript, each page would need to load the entire inventory, with all of its prices, in the page. While technically possible (look-up JavaScript "Arrays"), it isn't efficient.

For credit-card processing, there are a lot of ready-made tools. I would start with PayPal, as they offer complete merchant services to web developers.

Welcome to Daniweb! I moderate this forum, so am often the first to reply, but there are a lot of members here who are better HTML/JavaScript coders than I, so watch the thread for their responses.

This article has been dead for over six months. Start a new discussion instead.