Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8063855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:10:48+00:00 2026-06-05T11:10:48+00:00

I’m working on a project for class where we need to implement a couple

  • 0

I’m working on a project for class where we need to implement a couple of features. Right now the one that I’m stuck on is making the value in the order total textbox update automatically as users make selections using the radio buttons in the ComputerForm. If anyone could tell me how I should script this it would be most appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
    <title> Final: Computer Order Form </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="Joshua Aslan Smith">
    <meta name="Keywords" content="">
    <meta name="Description" content="Final Project">

    <script type="text/javascript">

        function doClear()
            {
                document.AddressForm.customer.value = "";
                document.AddressForm.address.value = "";
                document.AddressForm.city.value= "";
                document.AddressForm.state.options[0].selected = "true";
                document.AddressForm.zip.value = "";
                document.AddressForm.phone.value= "";
                document.AddressForm.email.value= "";

                document.ComputerForm.cases[0].checked = false;
                document.ComputerForm.cases[1].checked = false;
                document.ComputerForm.cases[2].checked = false;

                document.ComputerForm.monitors[0].checked = false;
                document.ComputerForm.monitors[1].checked = false;
                document.ComputerForm.monitors[2].checked = false;

                document.ComputerForm.printers[0].checked = false;
                document.ComputerForm.printers[1].checked = false;
                document.ComputerForm.printers[2].checked = false;

                return;
            }

        //function totalPrice()
            //{
            //  var t1 = document.ComputerForm.cases.selected.value;
            //  var t2 = document.ComputerForm.monitors.selected.value;
            //  var t3 = document.ComputerForm.printers.selected.value;
            //  var total = document.AddressForm.total.value;

        //      total.value = t1.value + t2.value + t3.value;
        //  }

    </script>


</head>

<body>  <h1 align="center">Computer System Order Form</h1>  <table border="black" cellpadding="10px" align="center">        <tr>            <td>
                <table cellpadding="10px">
                <form name="ComputerForm">
                    <tr>
                        <td>
                            Computer Case Style:</br>
                            <input type="radio" name="cases" value="500.00" /> Desktop Case (500.00) </br>
                            <input type="radio" name="cases" value="600.00" /> Mini-Tower Case (600.00) </br>
                            <input type="radio" name="cases" value="700.00" /> Full-Tower Case (700.00) </br>
                        </td>
                        <td>
                            <img src="case.jpg" alt="pc case" >/>   
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Computer Monitor: <br/>
                            <input type="radio" name="monitors" value="250.00" /> 17" LCD Flat Screen (250.00) </br>
                            <input type="radio" name="monitors" value="300.00" /> 19" LCD Flat Screen (300.00) </br>
                            <input type="radio" name="monitors" value="350.00" /> 21" LCD Flat Screen (350.00) </br>
                        </td>
                        <td>
                            <img src="monitor.jpg" alt="pc >monitor" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Computer Printer:<br/>
                            <input type="radio" name="printers" value="100.00" /> Inkjet Printer (100.00) </br>
                            <input type="radio" name="printers" value="250.00" /> Laser Printer (250.00) </br>
                            <input type="radio" name="printers" value="350.00" /> Color Printer (350.00) </br>
                        </td>
                        <td>
                            <img src="printer.jpg" alt="pc printer" />
                        </td>
                    </tr>
                </form>
                </table>            </td>           <td>
                <table padding="10px">
                    <tr>
                    <form name="AddressForm">
                        <td>
                            Total System Price:
                        </td>
                        <td>
                            $<input type="text" name="total" readonly value="0.00" size="8">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Full Name:
                        </td>
                        <td>
                            <input type="text" name="customer" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Street Address:
                        </td>
                        <td>
                            <input type="text" name="address" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            City:
                        </td>
                        <td>
                            <input type="text" name="city" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            State:
                        </td>
                        <td>
                            <select name="state">
                                <option value=""></option>
                                <option value="DE">DE</option>
                                <option value="NJ">NJ</option>
                                <option value="NY">NY</option>
                                <option value="PA">PA</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Zip:
                        </td>
                        <td>
                            <input type="text" name="zip" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Phone Number:
                        </td>
                        <td>
                            <input type="text" name="phone" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Email Address:
                        </td>
                        <td>
                            <input type="text" name="email">
                        </td>
                    </tr>
                    </form>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="button" value="Submit Order" onClick="doSubmit()" />
                        </td>
                        <td>
                            <input type="button" value="Clear Form" onClick="doClear()"  />
                        </td>
                    </tr>
                </table>            </td>       </tr>   </table> </body> </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:10:50+00:00Added an answer on June 5, 2026 at 11:10 am

    First, put the following code anywhere in your JS files:

    var prices = new Object();
    function updateTotal () {
        var total = 0.00;
        for (var price in prices) {
            total += price;
        }
        document.getElementById("total").value = total;   // Add the id "total" to the input field
    }
    

    Then for every radio button’s html tag add the follwing:

    onchange="javascript:prices['cases'] = parseInt(this.value); updateTotal();"
    

    and replace 'cases' with the respective values. Now when you add new prices all you have to do is add the onchange function to the appropriate tag and the updatePrice() function still works correctly without modification.

    See a working demo here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.