Question

HOW TO USE CHECKBOX + LISTBOX

Asked by: scriptless

web page shows details of 3 products(including price) associated with product should be listbox which allows user to pick how many of each product(up to 5 of each)

3 checkboxes associated with 3 products to allow user to opt for insurance.
insurance adds 20% to the total cost of product

Finally code should be included to allow values to be saved in a cookie.



Here's my code so far....
cut + paste to see output.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<SCRIPT LANGUAGE = JAVASCRIPT>
var total = document.myform.subtotal.value;

function calculate(){
      
      if(document.myform.item1.checked == true){
      total += (total * 0.20);
      }
      
      
      document.formName.subtotal1.value = total;

</script>
</head>

<body bgcolor="#00CCFF">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

   
<!--"Start of Table" -->
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
    <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
    <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
    <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
    <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
      <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
      <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
      
      <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
      <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
      <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">£1094</font></td><!--"shows price of product" -->
      
      
      <td align = "center" width="197" bgcolor="#eeeeee">
      <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
      <select name = "pick1">
      <option>1
      <option>2
      <option>3
      <option>4
      <option>5
      </select></p>
      </td>
      
      <form method="post" name="myform">       
      <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item1" type = "checkbox" onClick = "calculate()"></td><!--"Displays checkbox" -->
                  
      <td align = "center" width="227" bgcolor="#eeeeee">£<input type = "text" name = "subtotal1"></td><!--"Displays totalcost" -->
      </form>      
</tr>

<tr>
      
      <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
      <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
      <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">£269</font></td>
      
      <td align = "center" width="197" bgcolor="#eeeeee">
      <p><font face="MS Sans Serif">Select quantity </font>
      <select name = "pick2">
      <option>1
      <option>2
      <option>3
      <option>4
      <option>5
      </select></p>
      </td>
      
      <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item2" type = "checkbox"></td>
      <td align = "center" width="227" bgcolor="#eeeeee">£<input type = "text" name = "subtotal2"></td>
</tr>

<tr>
      
       <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
    <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
    <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">£260</font></td>
   
    <td align = "center" width="197" bgcolor="#eeeeee">
    <p><font face="MS Sans Serif">Select quantity</font>
    <select name = "pick3">
    <option>1
    <option>2
    <option>3
    <option>4
    <option>5
    </select></p>
    </td>
       
    <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item3" type = "checkbox"></td>
    <td align = "center" width="227" bgcolor="#eeeeee">£<input type = "text" name "subtotal3"</td>
</tr>
   
   <tr>
   <td colspan ="5" bgcolor = "999999">
    <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
    <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px"></td>
      </tr>
 

   
   
   
</table>
</body>

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-04-15 at 14:59:14ID20586304
Tags

use

,

checkbox

,

javascript

Topics

JavaScript

,

Font Creator

Participating Experts
5
Points
500
Comments
18

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Mp3 Player...
    Anyone know any coding for making a Mp3 player, or where I can get an example from?
  2. MP3 Player
    How do I make a simple Mp3 player?
  3. Mp3 Player
    Hi I need to make an mp3 player that can play, and put EQs on the output. Can I find some decryption code somewhere ? CB.
  4. How to use Checkboxes
    1.Web page shows details of 3 products including price. Associated with 3 products is listbox and checkbox. 2.user should be able to pick how many of each product (up to 5 of each) in listbox. 3.If user clicks checkbox 20% is added to total cost of product, and values ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ZvonkoPosted on 2003-04-15 at 16:04:43ID: 8337396

Try please this:


<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<SCRIPT LANGUAGE = JAVASCRIPT>
var prize = new Array();
prize[1] = 1094;
prize[2] = 269;
prize[3] = 260;

function calculate(){
  for(i=1;i<prize.length;i++){
     total=prize[i]*document.myform['pick'+i].selectedIndex;
     if(document.myform['item'+i].checked == true){
     total += (total * 0.20);
     }
     total = (total+'.0').split('.');
     total = total[0]+'.'+(total[1]+'00').substr(0,2);
     document.myform['subtotal'+i].value = total;
  }

}
</script>
</head>

<body bgcolor="#00CCFF">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

     <form method="post" name="myform">        
<!--"Start of Table" -->
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>
<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name = "pick1" onClick = "calculate()">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>

     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item1" type = "checkbox" onClick = "calculate()"></td><!--"Displays checkbox" -->
               
     <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name = "subtotal1"></td><!--"Displays totalcost" -->
   
</tr>
<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name = "pick2" onClick = "calculate()">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item2" type = "checkbox" onClick = "calculate()"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name = "subtotal2"></td>
</tr>

<tr>
     
      <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pick3" onClick = "calculate()">
   <option selected>0
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item3" type = "checkbox" onClick = "calculate()"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name="subtotal3"</td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" onClick = "calculate()" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px"></td>
     </tr>
 

 
 
 
</table>
</form>
</body>
</html>


 

by: kollegovPosted on 2003-04-15 at 20:32:20ID: 8338299

My one do calculations on-fly from onchange/onclick events
it recalculate subtotal for one row only (obvious optimisation on case large table) when changes happens
then it recalcutate gross total  as summ of subtotal for whole table and alert it
(you can change to fill total in gross total field )
So actually you do not need calc button.
Also fields for subtotal need to be done noneditable :)

P.S DO Not insert extra spaces like name = "some", this should be
name="value"
P.P.S Many other minor errors corrected...

Example tested with MIE5+



<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<script>

var price = new Array();
      price[1] = 1094;
      price[2] = 269;
      price[3] = 260;

function formatNum(n) {
  var n = n*100
  var s = n+"";
  while(s.length<3) s="0"+s;
  var l = s.length;
  return s.substring(0,l-2)+"."+s.substring(l-2);
}


function doCalc(num) {
   inx = document.myform.elements["pick"+num].selectedIndex;
   qty = inx >= 0 ?  document.myform.elements["pick"+num].options[inx].text : 0;
   subtotal = qty*price[num]
   if(document.myform.elements["item"+num].checked)    subtotal += subtotal*0.20;
   document.myform.elements["subtotal"+num].value = formatNum(subtotal);
   calculateTotal();
}

function calculateTotal() {
   f = document.myform;
   var total = 0;
   for(var i=0; i<f.elements.length;i++ ) {
       if(f.elements[i].name.indexOf("subtotal")==0) {

          var v = parseFloat(f.elements[i].value);
          if( !isNaN(v) ) {
            total += v;
          }
       }
   }
   alert("total="+formatNum(total))
}



</script>
</head>

<body bgcolor="#00CCFF">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

 
<!--"Start of Table" -->
<form method="post" name="myform">      
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name="pick1" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
     <input name="item1" type="checkbox" onClick="doCalc(this.name.substring(4))"></td><!--"Displays checkbox" -->
 
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotal1"></td><!--"Displays totalcost" -->

</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name="pick2" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
       <input name="item2" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotal2"></td>
</tr>

<tr>
     
   <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pick3" onChange="doCalc(this.name.substring(4))" >
   <option selected>0
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
    <input name="item3" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotal3"</td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" style="background-color:#ffffff; color:#000000; border:1px solid
#000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt;
letter-spacing=1px"></td>
     </tr>
 

 
 
 
</table>
     </form>    
</body>
</html>

 

by: rajesh75Posted on 2003-04-15 at 23:23:59ID: 8338965

This code is really robust.
how many ever products you have, this code takes care of it.

the only thing you have to take care is the naming of the textbox "subtotal".
its has to be subtotal0,subtotal1,....etc
the rest the code takes care of..

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<SCRIPT LANGUAGE = JAVASCRIPT>


function Calculate()
{
var intQty;
var intPrice;
var intInsurance;
var intTotal;
var strfinal = "";

     for(i=0;i<document.test.elements.length;i++)
     {
            if(document.test.elements[i].type=="select-one")
            {
            intQty = parseInt(document.test.elements[i].options[document.test.elements[i].options.selectedIndex].text);            
            }      
     }
      for(j=0;j < document.test.elements.length;j++)
      {
            if(document.test.elements[j].type=="checkbox")
            {
                  if(document.test.elements[j].checked==true)
                  {                  
                        intPrice = parseInt(document.test.elements[j].value);
                        intTotal = intQty * intPrice ;
                        intInsurance = (0.20 * intTotal) + intTotal;
                        strfinal = strfinal + intInsurance+ "||";      
                        
                  }
                  else
                  {                        
                        intPrice = parseInt(document.test.elements[j].value);
                        intTotal = intQty * intPrice;      
                        strfinal =       strfinal + intTotal + "||";                                          
                  }
            }      
      }
      var expiryDate = new Date();
      var arrFinal = strfinal.split("||");
      for(k=0;k<arrFinal.length-1;k++)
      {
      document.test.elements["subtotal" + k].value = arrFinal[k];
      //set syntax is like this..
      //setCookie(cookiename,value to be stored,expiry date);
      //setCookie("subtotal" + k,arrFinal[k],expiryDate.getDay()+7);
      //expires in 7 days
      }
      
      
}
</script>
</head>

<body bgcolor="#00CCFF">
<form name="test">
<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

 
<!--"Start of Table" -->
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name = "pick1">
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
       
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item1" type = "checkbox" value="1094"></td><!--"Displays checkbox" -->
               
     <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name = "subtotal0"></td><!--"Displays totalcost" -->
       
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name = "pick2">
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item2" type = "checkbox"value="269"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name = "subtotal1"></td>
</tr>

<tr>
     
      <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pick3">
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item3" type = "checkbox" value="260"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name= "subtotal2"></td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" onClick="Calculate();" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px"></td>
     </tr>
 

 
 
 </form>
</table>
</body>

use this link for cookies..coz I am not sure what you want to save as cookies.If you can tell me ,then I can help you with that too.
http://www.webreference.com/js/column8/functions.html
http://tech.irt.org/articles/js064/index.htm

regards,
rajesh

 

by: scriptlessPosted on 2003-04-16 at 04:20:17ID: 8340120

Answers seem to work.
But I need code to be included to allow values be saved in a cookie.would be grateful if repled to.
thx

 

by: ZvonkoPosted on 2003-04-16 at 12:50:32ID: 8343680

Ok, here my version enabled by cookie:


<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<SCRIPT LANGUAGE = JAVASCRIPT>
var prize = new Array();
prize[1] = 1094;
prize[2] = 269;
prize[3] = 260;
function calculate(){
 for(i=1;i<prize.length;i++){
    total=prize[i]*document.myform['pick'+i].selectedIndex;
    if(document.myform['item'+i].checked == true){
    total += (total * 0.20);
    }
    total = (total+'.0').split('.');
    total = total[0]+'.'+(total[1]+'00').substr(0,2);
    document.myform['subtotal'+i].value = total;
 }
 setState();
}
var oneWeek=604800000; // 7 * 24 * 60 * 60 * 1000
var oneMonth=2592000000 // 30 * 24 * 60 * 60 * 1000
var expireDate = (new Date((new Date()).getTime()+oneMonth)).toGMTString()+";";
function setState(){
  actState="eState="
  for(i=1;i<prize.length;i++){
     actState+='P'+i+':'+document.myform['pick'+i].selectedIndex+
               '('+document.myform['item'+i].checked+'),';
  }
  document.cookie=actState+';path=/;expires='+expireDate;
}
function getState(){
  cookies=document.cookie+';';
  if(actState=cookies.match(/eState=(.+);/)){
    actState=actState[1].split(',')
    for(i=0;i<actState.length;i++){
      if(P=actState[i].match(/P(\d+)\:(\d+)\((true|false)\)/)){
        document.myform['pick'+P[1]].options[P[2]].selected=true;
        document.myform['item'+P[1]].checked=(P[3]=='true');
      }
    }
  }
  calculate();
}
</script>
</head>
<body bgcolor="#00CCFF" onLoad="getState()">
<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>
    <form method="post" name="myform">        
<!--"Start of Table" -->
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
  <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
  <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
  <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
  <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
    <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
    <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>
<tr>
    <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
    <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
    <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#1094</font></td><!--"shows price of product" -->
    <td align = "center" width="197" bgcolor="#eeeeee">
    <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
    <select name = "pick1" onClick = "calculate()">
    <option selected>0
    <option>1
    <option>2
    <option>3
    <option>4
    <option>5
    </select></p>
    </td>
    <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item1" type = "checkbox" onClick = "calculate()"></td><!--"Displays checkbox" -->
    <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name = "subtotal1"></td><!--"Displays totalcost" -->
</tr>
<tr>
    <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
    <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
    <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#269</font></td>
    <td align = "center" width="197" bgcolor="#eeeeee">
    <p><font face="MS Sans Serif">Select quantity </font>
    <select name = "pick2" onClick = "calculate()">
    <option selected>0
    <option>1
    <option>2
    <option>3
    <option>4
    <option>5
    </select></p>
    </td>
    <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item2" type = "checkbox" onClick = "calculate()"></td>
    <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name = "subtotal2"></td>
</tr>
<tr>
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
  <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
  <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">#260</font></td>
  <td align = "center" width="197" bgcolor="#eeeeee">
  <p><font face="MS Sans Serif">Select quantity</font>
  <select name = "pick3" onClick = "calculate()">
  <option selected>0
  <option>1
  <option>2
  <option>3
  <option>4
  <option>5
  </select></p>
  </td>
  <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font><input name = "item3" type = "checkbox" onClick = "calculate()"></td>
  <td align = "center" width="227" bgcolor="#eeeeee">#<input type = "text" name="subtotal3"</td>
</tr>

 <tr>
 <td colspan ="5" bgcolor = "999999">
  <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" onClick = "calculate()" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
  <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt; letter-spacing=1px"></td>
    </tr>
</table>
</form>
</body>
</html>


 

by: kollegovPosted on 2003-04-16 at 19:26:41ID: 8345537

And my version :))
This version saves cookie as compact as possible
(cookies limited by standard 2K per site )
Tested with NN4+, MIE5+




<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<script>

var price = new Array();
      price[1] = 1094;
      price[2] = 269;
      price[3] = 260;


function setCookie(name,value)  {
   // one month expiration
   exp = new Date((new Date()).getTime()+1000*60*60*24*30);
   if((name==null)||(value==null)) return false;
   document.cookie =escape(name)+"="+escape(value)
                   +"; expires="+exp.toGMTString()
                   + "; path=/";
   return true;
}



function formatNum(n) {
  var n = n*100
  var s = n+"";
  while(s.length<3) s="0"+s;
  var l = s.length;
  return s.substring(0,l-2)+"."+s.substring(l-2);
}


function calcRow(num) {
   inx = document.myform.elements["pick"+num].selectedIndex;
   qty = inx >= 0 ?  document.myform.elements["pick"+num].options[inx].text : 0;
   setCookie("q"+num,qty);
   subtotal = qty*price[num]
   if(document.myform.elements["item"+num].checked) {
       subtotal += subtotal*0.20;
       setCookie("i"+num,1);
   }
   else {
       setCookie("i"+num,0);  
   }
   document.myform.elements["subtotal"+num].value = formatNum(subtotal);
}

function doCalc(num) {
   calcRow(num);
   calculateTotal();
}

function calculateTotal() {
   f = document.myform;
   var total = 0;
   for(var i=0; i<f.elements.length;i++ ) {
       if(f.elements[i].name.indexOf("subtotal")==0) {

          var v = parseFloat(f.elements[i].value);
          if( !isNaN(v) ) {
            total += v;
          }
       }
   }
   alert("total="+formatNum(total))
}


function init() {
   cook = document.cookie.split(/;/);
   for(i=0;i<cook.length;i++) {
        // trim value
        cook[i] = cook[i].replace(/^\s*/,'');
        if(cook[i].indexOf("q")==0) {
            nv = cook[i].split('=');
            cnum  = nv[0].substring(1);
            cval  = nv[1];
            document.myform.elements["pick"+cnum].selectedIndex=parseInt(cval);  
            calcRow(cnum);
        }
        if(cook[i].indexOf("i")==0) {
            nv = cook[i].split('=');
            cnum  = nv[0].substring(1);
            cval  = nv[1];
            if(cval!=0) {
              document.myform.elements["item"+cnum].checked=true;  
            }
            calcRow(cnum);
        }

   }
   calculateTotal();
}


</script>
</head>

<body bgcolor="#00CCFF" onload="init()">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

 
<!--"Start of Table" -->
<form method="post" name="myform">      
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name="pick1" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
     <input name="item1" type="checkbox" onClick="doCalc(this.name.substring(4))"></td><!--"Displays checkbox" -->
 
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotal1"></td><!--"Displays totalcost" -->

</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name="pick2" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
       <input name="item2" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotal2"></td>
</tr>

<tr>
     
   <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pick3" onChange="doCalc(this.name.substring(4))" >
   <option selected>0
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
    <input name="item3" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotal3"</td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" style="background-color:#ffffff; color:#000000; border:1px solid
#000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt;
letter-spacing=1px"></td>
     </tr>
 

 
 
 
</table>
     </form>    
</body>
</html>

 

by: rajesh75Posted on 2003-04-16 at 23:13:50ID: 8346175

I dont understand what you want to save in the cookie? Could you please elaborate on that?

 

by: ZvonkoPosted on 2003-04-17 at 00:02:46ID: 8346345

Hello kollegov,

now learn something from me :-)

You do not compress bytes, you waste cookies!!!

For example, if in first row is quantity two selected and security is checked, then you use eight bytes for this information and my cookie uses teen bytes.

But your method is limited to TEEN rows!!!

My method can store far more then hundred rows.

You bet?

 

by: kollegovPosted on 2003-04-17 at 19:49:02ID: 8352259

Hey, Zvonko...
Can you please tell me WHERE my method is limited to 10 ? !!!!
Nope, you are wrong! , it's not limited anywhere... (except total cookies length)

More, it can work with abstract string IDs of items  instead of numbers
Below example changed slightly to work with  "abc","def", "ghi" items
In this case of course it will require a bit more cookies to store as cookie names will be
"iabc" e.t.c

All I added is extra check that element in form with required name exists  
(case cookes contain values from previous other set of names which no more exists )
And changed names of elements in form to match used id strings

Your script which use enumerated values will make total mess when list of products changes
Let's say while first time visit it was spoon, fork and knife in store
and next time user comes it will be spoon, fork and cap available at the moment.
If during first visit  user selected 5 knifes then when he comes second time
YOUR script will select 5 CAPS instead of 5 knifes
My script wouldn't select nonexisting items
(Of course in case caps and forks have different IDs :)))))

Zvonko,  Who should learn a bit then ? You or me ?
Heheheh...

BTW, cookies can be compressed a bit more storing both values in a single cookie
Also added to this changed  example
Now each cookie looks like  qABC=y5
(name is "q"+productID, value is quantaty prepended with y/n for insurance )
I can't imagine how to compress it more (except throw out 'q' char :)


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<script>

var price = new Array();
      price["abc"] = 1094;
      price["def"] = 269;
      price["ghi"] = 260;


function setCookie(name,value)  {
   // one month expiration
   exp = new Date((new Date()).getTime()+1000*60*60*24*30);
   if((name==null)||(value==null)) return false;
   document.cookie =escape(name)+"="+escape(value)
                   +"; expires="+exp.toGMTString()
                   + "; path=/";
   return true;
}



function formatNum(n) {
  var n = n*100
  var s = n+"";
  while(s.length<3) s="0"+s;
  var l = s.length;
  return s.substring(0,l-2)+"."+s.substring(l-2);
}


function calcRow(num) {
  if(document.myform.elements["pick"+num]) {
   inx = document.myform.elements["pick"+num].selectedIndex;

   qty = inx >= 0 ?  document.myform.elements["pick"+num].options[inx].text : 0;

   subtotal = qty*price[num]
   if(document.myform.elements["item"+num].checked) {
       subtotal += subtotal*0.20;
       qty = "y"+qty
   }
   else {
       qty = "n"+qty
   }
   setCookie("q"+num,qty);

   document.myform.elements["subtotal"+num].value = formatNum(subtotal);
  }
}

function doCalc(num) {
   calcRow(num);
   calculateTotal();
}

function calculateTotal() {

   f = document.myform;
   var total = 0;
   for(var i=0; i<f.elements.length;i++ ) {
       if(f.elements[i].name.indexOf("subtotal")==0) {

          var v = parseFloat(f.elements[i].value);
          if( !isNaN(v) ) {
            total += v;
          }
       }
   }
   alert("total="+formatNum(total))
}


function init() {
   cook = document.cookie.split(/;/);
   for(i=0;i<cook.length;i++) {
        // trim value
        cook[i] = cook[i].replace(/^\s*/,'');
        if(cook[i].indexOf("q")==0) {
            nv = cook[i].split('=');
            cnum  = nv[0].substring(1);
            cval  = nv[1];
            if(document.myform.elements["pick"+cnum]) {
                document.myform.elements["pick"+cnum].selectedIndex=parseInt(cval.substring(1));  
                document.myform.elements["item"+cnum].checked=cval.indexOf('y')==0;  
                calcRow(cnum);
            }
        }

   }
   calculateTotal();
}


</script>
</head>

<body bgcolor="#00CCFF" onload="init()">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

 
<!--"Start of Table" -->
<form method="post" name="myform">      
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name="pickabc" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
     <input name="itemabc" type="checkbox" onClick="doCalc(this.name.substring(4))"></td><!--"Displays checkbox" -->
 
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotalabc"></td><!--"Displays totalcost" -->

</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name="pickdef" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
       <input name="itemdef" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotaldef"></td>
</tr>

<tr>
     
   <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pickghi" onChange="doCalc(this.name.substring(4))" >
   <option selected>0
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
    <input name="itemghi" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotalghi"</td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" style="background-color:#ffffff; color:#000000; border:1px solid
#000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt;
letter-spacing=1px"></td>
     </tr>
 

 
 
 
</table>
     </form>    
</body>
</html>

 

by: kollegovPosted on 2003-04-17 at 19:49:04ID: 8352260

Hey, Zvonko...
Can you please tell me WHERE my method is limited to 10 ? !!!!
Nope, you are wrong! , it's not limited anywhere... (except total cookies length)

More, it can work with abstract string IDs of items  instead of numbers
Below example changed slightly to work with  "abc","def", "ghi" items
In this case of course it will require a bit more cookies to store as cookie names will be
"iabc" e.t.c

All I added is extra check that element in form with required name exists  
(case cookes contain values from previous other set of names which no more exists )
And changed names of elements in form to match used id strings

Your script which use enumerated values will make total mess when list of products changes
Let's say while first time visit it was spoon, fork and knife in store
and next time user comes it will be spoon, fork and cap available at the moment.
If during first visit  user selected 5 knifes then when he comes second time
YOUR script will select 5 CAPS instead of 5 knifes
My script wouldn't select nonexisting items
(Of course in case caps and forks have different IDs :)))))

Zvonko,  Who should learn a bit then ? You or me ?
Heheheh...

BTW, cookies can be compressed a bit more storing both values in a single cookie
Also added to this changed  example
Now each cookie looks like  qABC=y5
(name is "q"+productID, value is quantaty prepended with y/n for insurance )
I can't imagine how to compress it more (except throw out 'q' char :)


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<script>

var price = new Array();
      price["abc"] = 1094;
      price["def"] = 269;
      price["ghi"] = 260;


function setCookie(name,value)  {
   // one month expiration
   exp = new Date((new Date()).getTime()+1000*60*60*24*30);
   if((name==null)||(value==null)) return false;
   document.cookie =escape(name)+"="+escape(value)
                   +"; expires="+exp.toGMTString()
                   + "; path=/";
   return true;
}



function formatNum(n) {
  var n = n*100
  var s = n+"";
  while(s.length<3) s="0"+s;
  var l = s.length;
  return s.substring(0,l-2)+"."+s.substring(l-2);
}


function calcRow(num) {
  if(document.myform.elements["pick"+num]) {
   inx = document.myform.elements["pick"+num].selectedIndex;

   qty = inx >= 0 ?  document.myform.elements["pick"+num].options[inx].text : 0;

   subtotal = qty*price[num]
   if(document.myform.elements["item"+num].checked) {
       subtotal += subtotal*0.20;
       qty = "y"+qty
   }
   else {
       qty = "n"+qty
   }
   setCookie("q"+num,qty);

   document.myform.elements["subtotal"+num].value = formatNum(subtotal);
  }
}

function doCalc(num) {
   calcRow(num);
   calculateTotal();
}

function calculateTotal() {

   f = document.myform;
   var total = 0;
   for(var i=0; i<f.elements.length;i++ ) {
       if(f.elements[i].name.indexOf("subtotal")==0) {

          var v = parseFloat(f.elements[i].value);
          if( !isNaN(v) ) {
            total += v;
          }
       }
   }
   alert("total="+formatNum(total))
}


function init() {
   cook = document.cookie.split(/;/);
   for(i=0;i<cook.length;i++) {
        // trim value
        cook[i] = cook[i].replace(/^\s*/,'');
        if(cook[i].indexOf("q")==0) {
            nv = cook[i].split('=');
            cnum  = nv[0].substring(1);
            cval  = nv[1];
            if(document.myform.elements["pick"+cnum]) {
                document.myform.elements["pick"+cnum].selectedIndex=parseInt(cval.substring(1));  
                document.myform.elements["item"+cnum].checked=cval.indexOf('y')==0;  
                calcRow(cnum);
            }
        }

   }
   calculateTotal();
}


</script>
</head>

<body bgcolor="#00CCFF" onload="init()">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

 
<!--"Start of Table" -->
<form method="post" name="myform">      
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name="pickabc" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
     <input name="itemabc" type="checkbox" onClick="doCalc(this.name.substring(4))"></td><!--"Displays checkbox" -->
 
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotalabc"></td><!--"Displays totalcost" -->

</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name="pickdef" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
       <input name="itemdef" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotaldef"></td>
</tr>

<tr>
     
   <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pickghi" onChange="doCalc(this.name.substring(4))" >
   <option selected>0
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
    <input name="itemghi" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotalghi"</td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" style="background-color:#ffffff; color:#000000; border:1px solid
#000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt;
letter-spacing=1px"></td>
     </tr>
 

 
 
 
</table>
     </form>    
</body>
</html>

 

by: ZvonkoPosted on 2003-04-17 at 22:57:35ID: 8352758

Hello kollegov, there are TWO limits for cookies: 2KB and twenty entries separated by an equal string for a site.
With twenty entries you use only sixty bytes in worst case. the next cookie with an equal assignment will overwrite one of the previous twenty cookies.

Check it and afterwards we can bet for some points :-)

Good Eastern, see you afterwards kollegov,
Zvonko

 

by: kollegovPosted on 2003-04-19 at 23:09:21ID: 8361738

Zvonko, You right, I forgot about 20 cookies per site limit ...

Well, here is my version changed to bypass this limitation too


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E-commerce Site</title>
<script>

var price = new Array();
      price["abc"] = 1094;
      price["def"] = 269;
      price["ghi"] = 260;


function getCookie(byname)
   {byname=byname+"=";
    nlen = byname.length;
    fromN = document.cookie.indexOf(byname);
    if((fromN) != -1)
        {fromN +=nlen
         toN=document.cookie.indexOf(";",fromN);
         if(toN < 0) {toN=document.cookie.length;}
         cookieval=unescape(document.cookie.substring(fromN,toN));
         if(cookieval=="") return null;
         return cookieval;
        }
    return null;
   }



function setCookie(name,value)  {
   // one month expiration
   exp = new Date((new Date()).getTime()+1000*60*60*24*30);
   if((name==null)||(value==null)) return false;
   document.cookie =escape(name)+"="+escape(value)
                   +"; expires="+exp.toGMTString()
                   + "; path=/";
   return true;
}



function formatNum(n) {
  var n = n*100
  var s = n+"";
  while(s.length<3) s="0"+s;
  var l = s.length;
  return s.substring(0,l-2)+"."+s.substring(l-2);
}


function calcRow(num) {
  if(document.myform.elements["pick"+num]) {
   inx = document.myform.elements["pick"+num].selectedIndex;
   qty = inx >= 0 ?  document.myform.elements["pick"+num].options[inx].text : 0;
   subtotal = qty*price[num]
   if(document.myform.elements["item"+num].checked) {
       subtotal += subtotal*0.20;
   }
   document.myform.elements["subtotal"+num].value = formatNum(subtotal);
  }
}

function doCalc(num) {
   calcRow(num);
   calculateTotal();
}

function calculateTotal() {

   f = document.myform;
   var total = 0;
   var state = "";
   for(var i=0; i<f.elements.length;i++ ) {
       if(f.elements[i].name.indexOf("subtotal")==0) {
          var num = f.elements[i].name.substring(8);
          var v = parseFloat(f.elements[i].value);
          if( !isNaN(v) ) {
            total += v;
          }
          inx = document.myform.elements["pick"+num].selectedIndex;
          if( inx >=0 ) {
             var ins = document.myform.elements["item"+num].checked ? " Y ":" N "
             state += num+ins+inx+" ";
          }
         
       }
   }
   setCookie("st",state);
   alert("total="+formatNum(total))
}


function init() {
   cook = getCookie("st").split(/\s/);
   for(i=0;i<cook.length;i+=2) {
        var num = cook[i]        
        if(document.myform.elements["pick"+num]) {
           document.myform.elements["item"+num].checked=cook[i+1].indexOf('Y')==0;  
           document.myform.elements["pick"+num].selectedIndex=parseInt(cook[i+2]);  
           calcRow(num);
        }

   }
   calculateTotal();
}


</script>
</head>

<body bgcolor="#00CCFF" onload="init()">

<h2 align="center"><u><font size="4"><b>Welcome to E-Commerce Website!</b></font></u></h2>
<p> </p>
<a href ="products.htm"><font size="1">Home</font></a>
<br><br><br><br>
<p><font face="Arial Narrow">Below are the prices of our products we currently
have in stock.</font></p>
<br><br><br>

 
<!--"Start of Table" -->
<form method="post" name="myform">      
<table width="893" border="1" BORDERCOLOR="#999999" cellspacing="0" cellpadding="2">
<tr>
   <td bgcolor="#999999" height="25" align="center" width="173"><font color="#FFFFFF">Product</font></td>
   <td bgcolor="#999999" align="center" width="50"><font color="#FFFFFF">Image</font></td>
   <td bgcolor="#999999" align="center" width="86"><font color="#FFFFFF">Price</font></td>
   <td bgcolor="#999999" align="center" width="197"><font color="#FFFFFF">Qty </font></td>
     <td bgcolor="#999999" align="center" width="122"><font color="#FFFFFF">Insurance</font></td>
     <td bgcolor="#999999" align="center" width="227"><font color="#FFFFFF">SubTotal</font></td>
</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony Camcorder</font></td>   <!--"shows name of product" -->
     <td align = "center" width="50"><img border="0" src="cam.jpg" width="50" height="50"></td><!--"Shows picture of product" -->
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?1094</font></td><!--"shows price of product" -->
     
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity</font><!--"Displays listbox" -->
     <select name="pickabc" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
     <input name="itemabc" type="checkbox" onClick="doCalc(this.name.substring(4))"></td><!--"Displays checkbox" -->
 
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotalabc"></td><!--"Displays totalcost" -->

</tr>

<tr>
     
     <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">Sony HiFi</font></td>
     <td align = "center" width="50"><img border="0" src="HiFi.jpg" width="50" height="50"></td>
     <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?269</font></td>
     
     <td align = "center" width="197" bgcolor="#eeeeee">
     <p><font face="MS Sans Serif">Select quantity </font>
     <select name="pickdef" onChange="doCalc(this.name.substring(4))">
     <option selected>0
     <option>1
     <option>2
     <option>3
     <option>4
     <option>5
     </select></p>
     </td>
     
     <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
       <input name="itemdef" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
     <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotaldef"></td>
</tr>

<tr>
     
   <td align = "center" width="173" bgcolor="#eeeeee"><font face="MS Sans Serif">MP3 Player</font></td>
   <td align = "center" width="50"><img border="0" src="MP3.jpg" width="50" height="50"></td>
   <td align = "center" width="86" bgcolor="#eeeeee"><font face="MS Sans Serif">?260</font></td>
   
   <td align = "center" width="197" bgcolor="#eeeeee">
   <p><font face="MS Sans Serif">Select quantity</font>
   <select name = "pickghi" onChange="doCalc(this.name.substring(4))" >
   <option selected>0
   <option>1
   <option>2
   <option>3
   <option>4
   <option>5
   </select></p>
   </td>
       
   <td align = "center" width="122" bgcolor="#eeeeee"><font face="MS Sans Serif">Insurance?</font>
    <input name="itemghi" type="checkbox" onClick="doCalc(this.name.substring(4))"></td>
   <td align = "center" width="227" bgcolor="#eeeeee">?<input type = "text" name="subtotalghi"</td>
</tr>
 
  <tr>
  <td colspan ="5" bgcolor = "999999">
   <td bgcolor="#999999" align="center"><input type="button"  value="Calculate" style="background-color:#ffffff; color:#000000; border:1px solid
#000000; font-family:tahoma; font-size:8pt; letter-spacing=1px">
   <input type="reset" value="Reset" style="background-color:#ffffff; color:#000000; border:1px solid #000000; font-family:tahoma; font-size:8pt;
letter-spacing=1px"></td>
     </tr>
 

 
 
 
</table>
     </form>    
</body>
</html>

 

by: ZvonkoPosted on 2003-04-21 at 09:21:01ID: 8367433

You forgot the twenty cookies limit, but not the five hundred points offer :-)

 

by: mplungjanPosted on 2004-01-25 at 12:54:23ID: 10197076

scriptless,
No comment has been added lately (279 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: split points between Zvonko http:#8337396 and kollegov http:#8338299 and rajesh75 http:#8338965

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

mplungjan
EE Cleanup Volunteer

 

by: probinePosted on 2004-02-10 at 02:03:24ID: 10320657

This message is to >> kollegov <<

Kollegov, your web site does not work. Can I get you e mail address ?

 

by: mplungjanPosted on 2004-02-10 at 03:00:36ID: 10320923

 

by: mplungjanPosted on 2004-02-10 at 03:01:09ID: 10320927

virtual_max@geocities.com

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...