•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 374,165 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,218 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 4554 | Replies: 2
![]() |
•
•
Join Date: Sep 2004
Location: Cheltenham, UK
Posts: 20
Reputation:
Rep Power: 4
Solved Threads: 0
I have a form where you select a player's name from a drop down list, and there are 6 input boxes next to it for their separate scores and a box at the end for their total score (all the separate scores summed).
I want to have the form dynamically calculate the total as you move between each field (or even just after the last field), and display it at the end of the row. The code for the first player is below:
I've tried the few methods I have seen around the net, but none of the example coding works - in IE I get script errors, and in Firefox nothing happens at all.
It looks fairly simple to do if you have knowlege of JavaScript; just put the calculation method at the top, and call it via an onblur="total()" or similar in the form input thing.
Can anyone help? Thanks!
I want to have the form dynamically calculate the total as you move between each field (or even just after the last field), and display it at the end of the row. The code for the first player is below:
Player 01 Name: <SELECT NAME=playerid1> <OPTION VALUE=0>Select Player... <?=$options?> </SELECT> <input type="text" name="p1h1" id="p1h1" size=1><input type="text" name="p1h2" id="p1h2" size=1><input type="text" name="p1h3" id="p1h3" size=1><input type="text" name="p1h4" id="p1h4" size=1><input type="text" name="p1h5" id="p1h5" size=1><input type="text" name="p1h6" id="p1h6" size=1> Total: <input type="text" name="score1" id="score1" size=2>
It looks fairly simple to do if you have knowlege of JavaScript; just put the calculation method at the top, and call it via an onblur="total()" or similar in the form input thing.
Can anyone help? Thanks!
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
•
•
•
•
Originally Posted by TimmyRaa
I have a form where you select a player's name from a drop down list, and there are 6 input boxes next to it for their separate scores and a box at the end for their total score (all the separate scores summed).
I want to have the form dynamically calculate the total as you move between each field (or even just after the last field), and display it at the end of the row. The code for the first player is below:
I've tried the few methods I have seen around the net, but none of the example coding works - in IE I get script errors, and in Firefox nothing happens at all.Player 01 Name: <SELECT NAME=playerid1> <OPTION VALUE=0>Select Player... <?=$options?> </SELECT> <input type="text" name="p1h1" id="p1h1" size=1><input type="text" name="p1h2" id="p1h2" size=1><input type="text" name="p1h3" id="p1h3" size=1><input type="text" name="p1h4" id="p1h4" size=1><input type="text" name="p1h5" id="p1h5" size=1><input type="text" name="p1h6" id="p1h6" size=1> Total: <input type="text" name="score1" id="score1" size=2>
It looks fairly simple to do if you have knowlege of JavaScript; just put the calculation method at the top, and call it via an onblur="total()" or similar in the form input thing.
Can anyone help? Thanks!
Link me to the HTML (or attach it)
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- how can i pass a value from java script to JSP scriplet (JSP)
- dynamic form filling (PHP)
- Storing dynamic form values in Arrays for display & insert (PHP)
- Problem with object declaration (C++)
- Dynamic Array, Writing to CSV, Floating Point ?'s (C)
- Need help in design and javascript code for Dynamic form (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: hmmm, expert CSS cheat ?
- Next Thread: Make your own javascript maze.



Linear Mode