Avatar of webdott
webdott
Flag for United States of America asked on

html form calculate price with input

i have the attached code, how can i add to it, like:

how many do you want?
input box -- I can enter in number 10 for example

price is $1 each

in the total box, it will take 10 x $1 = $10
and add that to any of the radio boxes total.

i hope that explains it.

thanks

<html>
    <head>
    <script type="text/javascript">
    
    function calculate(){
        var radioArray = new Array();
        var formObj = document.forms[0];
        var totalPrice = 0;
        for(var no=0;no<formObj.elements.length;no++){        
            if(formObj.elements[no].type=='radio' && !radioArray[formObj.elements[no].name]){
                
                var obj = formObj.elements[formObj.elements[no].name];
                for(var no2=0;no2<obj.length;no2++){
                    if(obj[no2].checked){
                        radioArray[formObj.elements[no].name] = true;
                        var stringArray = obj[no2].value.split('|');
                        var price = stringArray[1];
                        totalPrice = totalPrice/1 + price /1;
                    }                
                }
            }        
        }
        totalPrice = Math.round(totalPrice*100);
        totalPrice = totalPrice/100;
        document.forms[0].totalPrice.value = "$" + totalPrice;
    }
    
    
    function init(){
        for(var no=0;no<document.forms[0].elements.length;no++){
            if(document.forms[0].elements[no].type=='radio'){
                document.forms[0].elements[no].onclick=calculate;
            }
        }
    }
    </script>
<script language="javascript" type="text/javascript">

function PrintMeSubmitMe()
{
window.print();
}

function SubmitMe()
{
document.MyForm.submit();
}
</script>
    </head>
<body onload="init()">

<form  name="MyForm" action="somepage.asp" method="post">
Hard Drive Upgrade<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="120 GB 7,200 RPM SATA|0.00" checked> 120 GB 7,200 RPM SATA - Add $0.00<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="200 GB 7,200 RPM SATA|39.99"> 200 GB 7,200 RPM SATA - Add $39.99<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="250 GB 7,200 RPM SATA|79.99"> 250 GB 7,200 RPM SATA - Add $79.99<br>
<br>Second Hard Drive Options<br>
<input type="radio" name="option2|Second Hard Drive Options" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option2|Second Hard Drive Options" value="120 GB 7,200 RPM SATA|108.99"> 120 GB 7,200 RPM SATA - Add $108.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="200 GB 7,200 RPM SATA|145.99"> 200 GB 7,200 RPM SATA - Add $145.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="250 GB 7,200 RPM SATA|189.99"> 250 GB 7,200 RPM SATA - Add $189.99<br>
<br>Memory Upgrade<br>
<input type="radio" name="option3|Memory Upgrade" value="512 333 DDR Memory (1 DIMM)|0.00" checked> 512 333 DDR Memory (1 DIMM) - Add $0.00<br>
<input type="radio" name="option3|Memory Upgrade" value="1 GB 333 DDR Memory (2 DIMMs)|79.99"> 1 GB 333 DDR Memory (2 DIMMs) - Add $79.99<br>
<br>USB-UIRT IR Blaster Option<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="USB-UIRT IR Blaster|49.99"> USB-UIRT IR Blaster - Add $49.99<br>
<br>56K Modem Option<br>
<input type="radio" name="option5|56K Modem Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option5|56K Modem Option" value="56k Modem|20.00"> 56k Modem - Add $20.00<br>
<br>Wireless Ethernet Adapter<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465G|59.99"> Linksys WMP5465G - Add $59.99<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465S(Speed Boost)|69.99"> Linksys WMP5465S(Speed Boost) - Add $69.99<br>
<br>Wireless Router<br>
<input type="radio" name="option7|Wireless Router" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54G|69.99"> Linksys WRT54G - Add $69.99<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54GS(Speed Boost)|89.99"> Linksys WRT54GS(Speed Boost) - Add $89.99<br>
<br>Norton Internet Security<br>
<input type="radio" name="option8|Norton Internet Security" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option8|Norton Internet Security" value="12 Month Subscription|39.99"> 12 Month Subscription - Add $39.99<br>
<br>
<input type="text" name="totalPrice">
<input type="button" value="Print Quote" onclick="PrintMeSubmitMe(this)"></form>

</body>
</html>

Open in new window

Web Languages and StandardsHTMLJavaScript

Avatar of undefined
Last Comment
Rob

8/22/2022 - Mon
Rob

It would make sense for some items and not others.  which ones do you want them to be able to add multiples?
webdott

ASKER
sorry for not explaining, it would be a new item,

lets say,

cable sold by the foot
how many feet do you need?
<input box>

if i enter 10ft, i have the price hidden set at $1 per foot

so in the input of total text, it adds $10 [ or whatever the total is for that item ]
into the box

thanks
Rob

it's fairly straight forward and would just require an if...then...else statement in the calculation function to look for an input or i would suggest a drop down to remove the issues surrounding inputting non numerics.

i'll post back with a basic example of what i mean
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Rob

ok i've added the following if statement to your calculate function:

        if (formObj.elements[no].type == 'select-one') {
            var x=formObj.elements[no].selectedIndex;
            var y=formObj.elements[no].options;
            var price = y[x].value;
            //console.log("Index: " + y[x].index + " is " + y[x].value);
            totalPrice = totalPrice / 1 + price / 1; 
        }

Open in new window


also added a line to the init() function to make sure when the drop down is changed that it calls the calculate function:

     
  if (document.forms[0].elements[no].type == 'select-one') {
            document.forms[0].elements[no].onchange = calculate;
        }

Open in new window


see here for a full working version: http://jsfiddle.net/rjurd/gPaHy/
Rob

I've slightly changed the code to allow for you to change the price per foot - same link though
webdott

ASKER
thanks, but i am looking for entering in the number, not a drop down.

the script also does not work for me.

i will play with it.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
webdott

ASKER
got it to work like this with the dropbox

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>calculate price dropbox</title>
  
  <script type='text/javascript' src='/js/lib/dummy.js'></script>
  
  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  
  <style type='text/css'>
    
  </style>
  


<script type='text/javascript'>//<![CDATA[ 
window.onload=function(){
function calculate() {
    console.log("Calculating...")
    var radioArray = [];
    var formObj = document.forms[0];
    var totalPrice = 0;
    var no = 0;
    for (no = 0; no < formObj.elements.length; no++) {
        if (formObj.elements[no].type == 'radio' && !radioArray[formObj.elements[no].name]) {

            var obj = formObj.elements[formObj.elements[no].name];
            var no2 = 0;
            for (no2 = 0; no2 < obj.length; no2++) {
                if (obj[no2].checked) {
                    radioArray[formObj.elements[no].name] = true;
                    var stringArray = obj[no2].value.split('|');
                    var price = stringArray[1];
                    totalPrice = totalPrice / 1 + price / 1;
                }
                // calculate select boxes
                
            }
        }
        if (formObj.elements[no].type == 'select-one') {
            var x=formObj.elements[no].selectedIndex;
            var y=formObj.elements[no].options;
            var stringArray = formObj.elements[no].name.split('|');
            var price = stringArray[1];
            var feet = y[x].value;
            //console.log("Index: " + y[x].index + " is " + y[x].value);
            totalPrice = totalPrice / 1 + (price * feet) / 1; 
        }
    }
    totalPrice = Math.round(totalPrice * 100);
    totalPrice = totalPrice / 100;
    document.forms[0].totalPrice.value = "$" + totalPrice;
}


function init() {
    var no = 0;
    for (no = 0; no < document.forms[0].elements.length; no++) {
        if (document.forms[0].elements[no].type == 'radio') {
            document.forms[0].elements[no].onclick = calculate;
        }
        if (document.forms[0].elements[no].type == 'select-one') {
            document.forms[0].elements[no].onchange = calculate;
        }
    }
}

init();
}//]]>  

</script>
<script language="javascript" type="text/javascript">

function PrintMeSubmitMe()
{
window.print();
}

function SubmitMe()
{
document.MyForm.submit();
}
</script>

</head>
<body>
  <form  name="MyForm" action="somepage.asp" method="post">
Hard Drive Upgrade<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="120 GB 7,200 RPM SATA|0.00" checked> 120 GB 7,200 RPM SATA - Add $0.00<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="200 GB 7,200 RPM SATA|39.99"> 200 GB 7,200 RPM SATA - Add $39.99<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="250 GB 7,200 RPM SATA|79.99"> 250 GB 7,200 RPM SATA - Add $79.99<br>
<br>Second Hard Drive Options<br>
<input type="radio" name="option2|Second Hard Drive Options" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option2|Second Hard Drive Options" value="120 GB 7,200 RPM SATA|108.99"> 120 GB 7,200 RPM SATA - Add $108.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="200 GB 7,200 RPM SATA|145.99"> 200 GB 7,200 RPM SATA - Add $145.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="250 GB 7,200 RPM SATA|189.99"> 250 GB 7,200 RPM SATA - Add $189.99<br>
<br>Memory Upgrade<br>
<input type="radio" name="option3|Memory Upgrade" value="512 333 DDR Memory (1 DIMM)|0.00" checked> 512 333 DDR Memory (1 DIMM) - Add $0.00<br>
<input type="radio" name="option3|Memory Upgrade" value="1 GB 333 DDR Memory (2 DIMMs)|79.99"> 1 GB 333 DDR Memory (2 DIMMs) - Add $79.99<br>
<br>USB-UIRT IR Blaster Option<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="USB-UIRT IR Blaster|49.99"> USB-UIRT IR Blaster - Add $49.99<br>
<br>56K Modem Option<br>
<input type="radio" name="option5|56K Modem Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option5|56K Modem Option" value="56k Modem|20.00"> 56k Modem - Add $20.00<br>
<br>Wireless Ethernet Adapter<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465G|59.99"> Linksys WMP5465G - Add $59.99<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465S(Speed Boost)|69.99"> Linksys WMP5465S(Speed Boost) - Add $69.99<br>
<br>Wireless Router<br>
<input type="radio" name="option7|Wireless Router" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54G|69.99"> Linksys WRT54G - Add $69.99<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54GS(Speed Boost)|89.99"> Linksys WRT54GS(Speed Boost) - Add $89.99<br>
<br>Norton Internet Security<br>
<input type="radio" name="option8|Norton Internet Security" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option8|Norton Internet Security" value="12 Month Subscription|39.99"> 12 Month Subscription - Add $39.99<br>
<br>
<select name="cableLength|1">
    <option default value='0'>0</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    </select>    
     x feet of cable ($1 per foot)<br>
<select name="cableLength blue|2">
    <option default value='0'>0</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    </select>    
     x feet of cable blue ($2 per foot)<br>
<input type="text" name="totalPrice">
<input type="button" value="Print Quote" onclick="PrintMeSubmitMe(this)"></form>

  
</body>


</html>

Open in new window


but still looking for the person to enter in the digit, they could need 100 feet
and i do not want them to scroll that far in a dropbox.

thanks, this is one the right track
ASKER CERTIFIED SOLUTION
Rob

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Rob

I've also tested this in Chrome, Firefox and IE with no issues
webdott

ASKER
thanks for the input box.
sorry, the code is working, just not the print on submit,
so i added that back in as it's own script and it works in
safari, chrome, firefox, and opera - but not in ie8

this is what i have, same code - just different print function
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>input total print</title>
  
  <script type='text/javascript' src='/js/lib/dummy.js'></script>
  
  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  
  <style type='text/css'>
    
  </style>
  


<script type='text/javascript'>//<![CDATA[ 
window.onload=function(){
function calculate() {
    console.log("Calculating...")
    var radioArray = [];
    var formObj = document.forms[0];
    var totalPrice = 0;
    var no = 0;
    for (no = 0; no < formObj.elements.length; no++) {
        if (formObj.elements[no].type == 'radio' && !radioArray[formObj.elements[no].name]) {

            var obj = formObj.elements[formObj.elements[no].name];
            var no2 = 0;
            for (no2 = 0; no2 < obj.length; no2++) {
                if (obj[no2].checked) {
                    radioArray[formObj.elements[no].name] = true;
                    var stringArray = obj[no2].value.split('|');
                    var price = stringArray[1];
                    totalPrice = totalPrice / 1 + price / 1;
                }
            }
        }
        if (formObj.elements[no].className == 'calculate') {
            var stringArray = formObj.elements[no].name.split('|');
            var price = stringArray[1];
            var feet = formObj.elements[no].value;
            totalPrice = totalPrice / 1 + (price * feet) / 1; 
        }
    }
    totalPrice = Math.round(totalPrice * 100);
    totalPrice = totalPrice / 100;
    document.forms[0].totalPrice.value = "$" + totalPrice;
}


function init() {
    var no = 0;
    for (no = 0; no < document.forms[0].elements.length; no++) {
        if (document.forms[0].elements[no].type == 'radio') {
            document.forms[0].elements[no].onclick = calculate;
        }
        if (document.forms[0].elements[no].className == 'calculate') {
            document.forms[0].elements[no].onkeyup = calculate;
        }
    }
}

init();
}//]]>  

</script>
<script language="javascript" type="text/javascript">

function PrintMeSubmitMe()
{
window.print();
}

function SubmitMe()
{
document.MyForm.submit();
}
</script>

</head>
<body>
  <form  name="MyForm" action="somepage.asp" method="post">
Hard Drive Upgrade<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="120 GB 7,200 RPM SATA|0.00" checked> 120 GB 7,200 RPM SATA - Add $0.00<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="200 GB 7,200 RPM SATA|39.99"> 200 GB 7,200 RPM SATA - Add $39.99<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="250 GB 7,200 RPM SATA|79.99"> 250 GB 7,200 RPM SATA - Add $79.99<br>
<br>Second Hard Drive Options<br>
<input type="radio" name="option2|Second Hard Drive Options" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option2|Second Hard Drive Options" value="120 GB 7,200 RPM SATA|108.99"> 120 GB 7,200 RPM SATA - Add $108.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="200 GB 7,200 RPM SATA|145.99"> 200 GB 7,200 RPM SATA - Add $145.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="250 GB 7,200 RPM SATA|189.99"> 250 GB 7,200 RPM SATA - Add $189.99<br>
<br>Memory Upgrade<br>
<input type="radio" name="option3|Memory Upgrade" value="512 333 DDR Memory (1 DIMM)|0.00" checked> 512 333 DDR Memory (1 DIMM) - Add $0.00<br>
<input type="radio" name="option3|Memory Upgrade" value="1 GB 333 DDR Memory (2 DIMMs)|79.99"> 1 GB 333 DDR Memory (2 DIMMs) - Add $79.99<br>
<br>USB-UIRT IR Blaster Option<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="USB-UIRT IR Blaster|49.99"> USB-UIRT IR Blaster - Add $49.99<br>
<br>56K Modem Option<br>
<input type="radio" name="option5|56K Modem Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option5|56K Modem Option" value="56k Modem|20.00"> 56k Modem - Add $20.00<br>
<br>Wireless Ethernet Adapter<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465G|59.99"> Linksys WMP5465G - Add $59.99<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465S(Speed Boost)|69.99"> Linksys WMP5465S(Speed Boost) - Add $69.99<br>
<br>Wireless Router<br>
<input type="radio" name="option7|Wireless Router" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54G|69.99"> Linksys WRT54G - Add $69.99<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54GS(Speed Boost)|89.99"> Linksys WRT54GS(Speed Boost) - Add $89.99<br>
<br>Norton Internet Security<br>
<input type="radio" name="option8|Norton Internet Security" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option8|Norton Internet Security" value="12 Month Subscription|39.99"> 12 Month Subscription - Add $39.99<br>
<br>
<input type='text' name="cableLength|1.99" class="calculate">
     x feet of cable ($1.99 per foot)<br><br>
<input type="text" name="totalPrice">
<input type="button" value="Print Quote" onclick="PrintMeSubmitMe(this)"></form>

  
</body>


</html>

Open in new window

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Rob

What exactly doesn't work in IE8?  the submit, the print or both?
webdott

ASKER
fixed it, i had to remove the code in the script
console.log("Calculating...")

this works in all of them
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>input total print</title>
  
  <script type='text/javascript' src='/js/lib/dummy.js'></script>
  
  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  
  <style type='text/css'>
    
  </style>
  


<script type='text/javascript'>//<![CDATA[ 
window.onload=function(){
function calculate() {
    var radioArray = [];
    var formObj = document.forms[0];
    var totalPrice = 0;
    var no = 0;
    for (no = 0; no < formObj.elements.length; no++) {
        if (formObj.elements[no].type == 'radio' && !radioArray[formObj.elements[no].name]) {

            var obj = formObj.elements[formObj.elements[no].name];
            var no2 = 0;
            for (no2 = 0; no2 < obj.length; no2++) {
                if (obj[no2].checked) {
                    radioArray[formObj.elements[no].name] = true;
                    var stringArray = obj[no2].value.split('|');
                    var price = stringArray[1];
                    totalPrice = totalPrice / 1 + price / 1;
                }
            }
        }
        if (formObj.elements[no].className == 'calculate') {
            var stringArray = formObj.elements[no].name.split('|');
            var price = stringArray[1];
            var feet = formObj.elements[no].value;
            totalPrice = totalPrice / 1 + (price * feet) / 1; 
        }
    }
    totalPrice = Math.round(totalPrice * 100);
    totalPrice = totalPrice / 100;
    document.forms[0].totalPrice.value = "$" + totalPrice;
}


function init() {
    var no = 0;
    for (no = 0; no < document.forms[0].elements.length; no++) {
        if (document.forms[0].elements[no].type == 'radio') {
            document.forms[0].elements[no].onclick = calculate;
        }
        if (document.forms[0].elements[no].className == 'calculate') {
            document.forms[0].elements[no].onkeyup = calculate;
        }
    }
}

init();
}//]]>  

</script>
<script language="javascript" type="text/javascript">

function PrintMeSubmitMe()
{
window.print();
}

function SubmitMe()
{
document.MyForm.submit();
}
</script>

</head>
<body>
  <form  name="MyForm" action="somepage.asp" method="post">
Hard Drive Upgrade<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="120 GB 7,200 RPM SATA|0.00" checked> 120 GB 7,200 RPM SATA - Add $0.00<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="200 GB 7,200 RPM SATA|39.99"> 200 GB 7,200 RPM SATA - Add $39.99<br>
<input type="radio" name="option1|Hard Drive Upgrade" value="250 GB 7,200 RPM SATA|79.99"> 250 GB 7,200 RPM SATA - Add $79.99<br>
<br>Second Hard Drive Options<br>
<input type="radio" name="option2|Second Hard Drive Options" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option2|Second Hard Drive Options" value="120 GB 7,200 RPM SATA|108.99"> 120 GB 7,200 RPM SATA - Add $108.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="200 GB 7,200 RPM SATA|145.99"> 200 GB 7,200 RPM SATA - Add $145.99<br>
<input type="radio" name="option2|Second Hard Drive Options" value="250 GB 7,200 RPM SATA|189.99"> 250 GB 7,200 RPM SATA - Add $189.99<br>
<br>Memory Upgrade<br>
<input type="radio" name="option3|Memory Upgrade" value="512 333 DDR Memory (1 DIMM)|0.00" checked> 512 333 DDR Memory (1 DIMM) - Add $0.00<br>
<input type="radio" name="option3|Memory Upgrade" value="1 GB 333 DDR Memory (2 DIMMs)|79.99"> 1 GB 333 DDR Memory (2 DIMMs) - Add $79.99<br>
<br>USB-UIRT IR Blaster Option<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option4|USB-UIRT IR Blaster Option" value="USB-UIRT IR Blaster|49.99"> USB-UIRT IR Blaster - Add $49.99<br>
<br>56K Modem Option<br>
<input type="radio" name="option5|56K Modem Option" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option5|56K Modem Option" value="56k Modem|20.00"> 56k Modem - Add $20.00<br>
<br>Wireless Ethernet Adapter<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465G|59.99"> Linksys WMP5465G - Add $59.99<br>
<input type="radio" name="option6|Wireless Ethernet Adapter" value="Linksys WMP5465S(Speed Boost)|69.99"> Linksys WMP5465S(Speed Boost) - Add $69.99<br>
<br>Wireless Router<br>
<input type="radio" name="option7|Wireless Router" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54G|69.99"> Linksys WRT54G - Add $69.99<br>
<input type="radio" name="option7|Wireless Router" value="Linksys WRT54GS(Speed Boost)|89.99"> Linksys WRT54GS(Speed Boost) - Add $89.99<br>
<br>Norton Internet Security<br>
<input type="radio" name="option8|Norton Internet Security" value="None|0.00" checked> None - Add $0.00<br>
<input type="radio" name="option8|Norton Internet Security" value="12 Month Subscription|39.99"> 12 Month Subscription - Add $39.99<br>
<br>
<input type='text' name="cableLength|1.99" class="calculate">
     x feet of cable ($1.99 per foot)<br><br>
<input type="text" name="totalPrice">
<input type="button" value="Print Quote" onclick="PrintMeSubmitMe(this)"></form>

  
</body>


</html>

Open in new window

webdott

ASKER
the print function when clicking the submit does not work when you keep the
print script combined with the calculation script. seperated they work.

the IE issue was that it would not calculate anything. it had the error on the first code
console.log("Calculating...")

so it works now in all of them.

thanks
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
webdott

ASKER
thanks for doing all of that!
i really appreciate all of your help

thanks again
Rob

no problem... console is obviously not an object in IE - sorry about that! :)