www.webdeveloper.com
Results 1 to 9 of 9

Thread: Please, Can Someone Help Me Create Simple Script?

  1. #1
    Join Date
    Mar 2014
    Posts
    47

    Please, Can Someone Help Me Create Simple Script?

    Hi, I have some knowledge of HTML and Javascript but am a little unsure of how exactly to go about doing what I want or where to start.

    I have used Photoshop to create a mockup of what I am trying to achieve.

    Basically I already have the information that I want, I want to be able to select a dropdown box and then it autofills the text boxes with information.

    At the very bottom of it all I want to perform a calculation with simply adds all the information from column 1 and then the same for column 2 etc etc.

    I hope someone can point me in right direction or even offer some assistance.

    Thank you, please ask any questions.

    Here is the picture of my end goal.

    HTML Code:
    http://imageshack.com/a/img543/6520/qmk2.jpg
    http://imageshack.com/a/img543/6520/qmk2.jpg

  2. #2
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    865
    It doesn't look like what you want is complicated, however it does look like more information would be needed to give you anything complete.

    You seem to have a lot of fields and in this case it would be useful to see what the values for these fields would be. For example, you have 8 dropdown (<select>) boxes on the page and we only see one of the possible values. You also stated changing the dropdown would automatically fill the textboxes with information and so it would also be helpful to see some examples of what that information would be.

    It's just kind of hard to build a script that preforms calculations when I have no idea what I'm supposed to be calculating.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  3. #3
    Join Date
    Mar 2014
    Posts
    47
    Quote Originally Posted by Sup3rkirby View Post
    It doesn't look like what you want is complicated, however it does look like more information would be needed to give you anything complete.

    You seem to have a lot of fields and in this case it would be useful to see what the values for these fields would be. For example, you have 8 dropdown (<select>) boxes on the page and we only see one of the possible values. You also stated changing the dropdown would automatically fill the textboxes with information and so it would also be helpful to see some examples of what that information would be.

    It's just kind of hard to build a script that preforms calculations when I have no idea what I'm supposed to be calculating.
    Thanks for the reply, OK basically when someone uses a drop down box the boxes are all filled with a numeric value linked to each individual dopdown box.

    The values I have listed that I can input myself, these are numbers from 0-10, so each of the 6 boxes beside each drop down has a value between 0-10 then an assigned percentage value at the far right.

    Once all the values are selected I want to caculate totals for all the columns.

    So the row at the bottom that's says totals 1: would total each value from the drop down box in the row beside it saying 1: then do the same for 2: and then a total for the % column.

    Can you help?

  4. #4
    Join Date
    Mar 2014
    Posts
    47
    Quote Originally Posted by Sup3rkirby View Post
    It doesn't look like what you want is complicated, however it does look like more information would be needed to give you anything complete.

    You seem to have a lot of fields and in this case it would be useful to see what the values for these fields would be. For example, you have 8 dropdown (<select>) boxes on the page and we only see one of the possible values. You also stated changing the dropdown would automatically fill the textboxes with information and so it would also be helpful to see some examples of what that information would be.

    It's just kind of hard to build a script that preforms calculations when I have no idea what I'm supposed to be calculating.
    Would it be poiisibly for you to show me an example of this and I could add the values and edit it with your help

  5. #5
    Join Date
    Mar 2014
    Posts
    47
    Ok here is some more information as requested.

    For example in the race track dropdown there would would these fields, Ascot, Wolverhampton, Lingfield etc

    If a user selects Wolverhampton then in the fields for the

    Row 1: 3,2,2,3,3,2
    Row 2: 1,1,2,0,1,1

    The the % box would be filled with 8.75

    I would input these values if you could give example, these values will never change and be preloaded.

    that is for one drop down, its pretty much the same for the rest of the dropdowns.

    At the very bottom the calculation is simply Row 1 each column header calculated and totalled up and then the same for percentage and Row 2.

  6. #6
    Join Date
    Oct 2013
    Posts
    484
    Try this:
    Attached Files Attached Files

  7. #7
    Join Date
    Mar 2014
    Posts
    47
    Quote Originally Posted by Kevin2 View Post
    Try this:
    Hi kevin2 thanks for this, I just need to figure out how to edit everything now.

    One thing it doesnt seem to be doing anything in Internet Explorer, I have it working ok in Google Chrome but not Internet Explorer.

  8. #8
    Join Date
    Oct 2013
    Posts
    484
    Which version of IE? It should work on 9+. IE8 doesn't recognize getElementsByClassName which I used to help calculate the totals.

  9. #9
    Join Date
    Mar 2014
    Posts
    47
    Quote Originally Posted by Kevin2 View Post
    Which version of IE? It should work on 9+. IE8 doesn't recognize getElementsByClassName which I used to help calculate the totals.
    Hi kevin2, can you check out my other thread it is about editing your code, I am having some trouble with so posted a new thread to see if could get some help on it.

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