Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I need help with building a computer business website

    HELP!!!
    I need help with building a computer website to where I can have people customize and PC and it will tell their price (either in real-time or by clicking a button to update). Now I know all it takes is some java script in the head or wherever on the page, but since I am a noob at javascript, I have no clue.

    If anybody could help me as in actually building a site, or just giving my tutorial url's or emails; that would be greatly appreciated.

    Thanks,
    Ryan

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try the following links:

    Webmonkey

    HtmlGoodies

    w3schools

    They should give you the basics. They won't give you ready made scripts, but should guide you on some stuff.

    Duniyadnd

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know HTML, it is just that i want to define a variable and then total the value of all variables but I dont know how to do it, here is an example:

    function calculateTotal() {
    var Motherboard=document.Configuration(name of the form).Motherboard(name of the box).value
    var total= (all vars)

    }

    It has an error...and I dont know the correct operators to use when trying to get the value.

    Remember i am trying to get specific values of choices in drop down boxes.

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    can we see the page you're working on? that would make it easier
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure...here is my web site
    Attached Files Attached Files

  • #6
    New Coder
    Join Date
    Jul 2002
    Location
    Detroit MI
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is actually quite simple. Make an array for each select box.
    Code:
    	var CPUvalue = new Array(3)
    	CPUvalue[0] = 75
    	CPUvalue[1] = 100
    	CPUvalue[2] = 125
    
    	varMOBvalue = new Array(3)
    	MOBvalue[0] = 125
    	MOBvalue[1] = 150
    	MOBvalue[0] = 135
    0 corresponds to the first entry in the select box, 1 to the second, etc.
    And then you would need a function not unsimilar to this:
    Code:
    function computeTotal(form)
    CPU = CPUvalue[form.CPU.selectedIndex]
    MOB = MOBvalue[form.Mainboard.selectedIndex]
    
    total = (CPU + MOB)
    
    form.total.value = total
    Code:
    <form name="form">
    <select size="1" name="CPU" onChange="computeTotal(this.form)>
    <option>Option 1</option>
    <option>Option 2</option>
    <option>Option 3</option>
    </select>
    
    <select size="1" name="Mainboard" onChange="computeTotal(this.form)>
    <option>Option 1</option>
    <option>Option 2</option>
    <option>Option 3</option>
    </select>
    
    <input type="text" name="total" size="10">
    Of course if you want to get fancy, you could always just put total in a document.write

    If you have any other questions regarding this, or would like to see a full scale example, feel free to email me @ mojuba@comcast.net
    Oh I almost forgot, if you want the script to total up on page load just add onload="computeTotal(this.form)" to the BODY tag.


  •  

    Posting Permissions

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