www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help with adding JavaScript to calculate HTML document

Hybrid View

  1. #1
    Join Date
    Feb 2014
    Posts
    14

    Help with adding JavaScript to calculate HTML document

    For this part I have to create a page that takes orders in the appropriate boxes and once the "Calculate" button is hit, both the Add-on totals and the Grand total areas are calculated. I have the HTML file pretty much done, it's the JS and the CSS that I and about 10 other people are left in the dark about.

    HTML file
    Code:
    <!DOCTYPE html>
    <!-- EX02.html-->
    
    <html lang = "en">
    <head>
    
    <title> Basic Computer Store </title>
    				</head>
    
    <body>
    <h2> Welcome to the Basic Computer Store </h2>
    <h3> choose your Basic Upgrades for a basic price </h3>
    
    <img class = "Left" src = "download.png" alt = "Picture of computer"/>
    <table>
    
    <tr> 
    <th>   </th>
    <th>    </th>
    <th> Base Price </th>
    <th> $999.99 </th>
    			</tr>
    <tr> 
    <th> Add-on </th>
    <th> quantity </th>
    <th> Add-on Price </th>
    <th> Add-on Total </th>
    			</tr>
    <tr>
    <td> 1.21 Jiggawatt Powersupply </td>
    <td> <input type="text" name="PowerSupply" id="PowerSupply" alt="PowerSupply" value=" " size = "2" /> </td>
    <td> $1985 </td>
    <td> <input type="text" name="PowerSupplyPrice" size = "2" /> </td>
    </tr>
    
    <tr>
    <td> Brainpower (tm) Memory Upgrade </td>
    <td> <input type= text" name="Memory" size="2" /> </td>
    <td> $1337 </td>
    <td> <input type="text" name="MemoryPrice" size="2" /> </td>
    </tr>
    
    <tr>
    <td> Mouse </td>
    <td> <input type = "text" name = "Mouse" size = "2" /> </td>
    <td> $1 </td>
    <td> <input type = "text" name = "MousePrice" size = "2" /> </td>
    </tr>
    
    <tr>
    <td>   </td>
    <td>   </td>
    <td> Grand Total </td>
    <td> <input type = "text" name = "TotalPrice" value =" " size = "2" /> </td>
    </tr>
    
    <p>
    <input type="button" value="Calculate" onClick="">
    <a href = "http://www.hpu.edu/"> <input type="button" value="exit" onClick=""> </a>
    for the CSS file:
    I have to find a way to make a notification pop up if less than 1 of any item is ordered or more than 5 is ordered (0-5 minmax), or if any non-numbers are added.

    but I'll probably ask that later.

  2. #2
    Join Date
    Feb 2014
    Posts
    14
    Please disregard this post and look for the other one, I was able to get further and did not know about the delay in thread posting

    sorry about that

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles