SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot pooney's Avatar
    Join Date
    Jan 2006
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS PC System Builder

    Hi,

    I'm redesigning a system builder for a pc shop. The original builder worked well but needed a re-design and update, I changed the products and gave it a new look but now the javascript won't work. Each option for a product (example: product=processor, option=amd64blah) is a radio button and there is a price box next to all the options which should update the price according to which option (radio button) has been clicked. This isn't working, and I'm sure I haven't even changed any of the code so it's frustrating the crap out of me.

    Heres the original:
    http://86.53.2.2/buildvaluehomesys.php

    And my version:
    http://www.acmw-trade.com/buildparts.php

    If anybody can point me in the right direction I'll love you forever.

    Thanks,

    Tom.
    Web Host Advice - Under Development

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Your modified page is blank.

    Also, the javascript is so simplistic and so poorly written it should be binned. It's so pathetic, I think it should be recorded in this forum's archives for anyone who wants a good laugh:
    Code:
    function total(warranty) {
    
    var term3a=eval(document.builds.pricing3a.value)
    var term5a=eval(document.builds.pricing5a.value)
    var term6a=eval(document.builds.pricing6a.value)
    var term7a=eval(document.builds.pricing7a.value)
    var term8a=eval(document.builds.pricing8a.value)
    var term9a=eval(document.builds.pricing9a.value)
    var term10a=eval(document.builds.pricing10a.value)
    var term11a=eval(document.builds.pricing11a.value)
    var term12a=eval(document.builds.pricing12a.value)
    var term13a=eval(document.builds.pricing13a.value)
    var term14a=eval(document.builds.pricing14a.value)
    var term15a=eval(document.builds.pricing15a.value)
    var term16a=eval(document.builds.pricing16a.value)
    
    var total= + "314.99" + eval(term3a) + eval(term5a) + eval(term6a) + eval(term7a) + eval(term8a) + eval(term9a) + eval(term10a) + eval(term11a) + eval(term12a) + eval(term13a) + eval(term14a) + eval(term15a) + eval(term16a)
    
    document.builds.total.value=cent(Math.round(total*Math.pow(10,2))/Math.pow(10,2))
    }


Bookmarks

Posting Permissions

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