| | |
Product List and Order Form Submit
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2004
Posts: 40
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
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:
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.
The same thing. Items you need to research:
Very good. In fact, you should consider using ASP for the entire application. Look at ASP's "Request" and "Response" objects.
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.
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...
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.
- 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)
•
•
•
•
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 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.
![]() |
Similar Threads
- php script for dropdown to fetch DB list and then Tables (PHP)
- online transaction system (PHP)
- Files linked to MySQL records (PHP)
- online order form required fields not working (PHP)
- form submit redirect help, please (HTML and CSS)
- cannot get the sendmail to actualy send an email with the form selections (PHP)
- Passing a drop down list item's value (HTML and CSS)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: age advancing script?
- Next Thread: javascript-firefox issues
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child close column createrange() css cursor decimal dependent design disablefirebug dom download dropdown editor element embed engine error events explorer ext file form forms google gwt gxt hiddenvalue highlightedword hint html htmlform ie8 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jump libcurl listbox math media microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php player post problem progressbar regex runtime scroll search security select shopping size software sql text textarea unicode w3c web website window windowofwords windowsxp wysiwyg \n






