JavaScript for E-Commerce

Back | Contents | Next
Please note that this tutorial was first published in the year 2000, and is based on work conducted between 1997 and 2000. While we trust that it still constitutes useful tutorial material, it should not necessarily be construed as to impart best practice in the year 2017. For more details please see this blog post.

Framework - cat-cd.html, ...

The cat-cd.html, cat-record.html, cat-tape.html files include drop down lists for all of the categories in each product type.




function selectCategory() {
    var e = document.categoryForm.selCategory;
    parent.itemFrame.location = e.options[e.selectedIndex].value;
    if(e.selectedIndex == 0) {
        parent.parent.contentFrame.location = "main.html";



<form name="categoryForm">

<font size="-1">Category:<br></font>

<select name="selCategory" onChange="selectCategory();">
    <option value="item-initial.html" selected>Welcome...</option>
    <option value="item-cd-blues.html">Blues</option>
    <option value="item-cd-classical.html">Classical</option>
    <option value="item-cd-country.html">Country</option>
    <option value="item-cd-rock.html">Rock</option>
    <option value="item-cd-techno.html">Techno</option>





Only the source of cat-cd.html is listed here.

These files take much the same form as the product.html file, but instead of the drop down list showing product types it shows categories.

The selectCategory function here works almost exactly the same way as the selectProduct function in the product.html file. The difference is that it is loading item*.html files into the item list frame, and that if the first option ("Welcome...") is selected, the main.html file is loaded into the content frame.

Back | Contents | Next

This tutorial has been translated to Serbo-Croatian language by Jovana Milutinovich from

This tutorial has been translated to Slovak by Juraj Rehorovsky from Coupofy team.

If you find this tutorial useful and want to show your apprectiation, a small donation is most welcome, either in Bitcoins to 19QpWDmZPmTqawcr8VsXcbdc4Znq1ecrza, or via PayPal.