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

    Instantly Calculate checkbox values

    So I have a series of drop down boxes and check boxes with values that are populated from a record set from mysql. How can I have it so when a value is changed, a text boxs value is automatically updated. Anyone know any exsisting examples I can modify?

    I am sure this will need some type of java code working with the PHP.

    Here is kind of a wierd example of what I want to do:

    Dropdown Box1:
    Option 1 "Hat" Value "5.00"
    Option 2 "Glove" Value "1.00"
    Option 3 "Shirt" Value "2.00"

    Dropdown Box2:
    Option 1 "White" Value "1.00"
    Option 2 "Red" Value "1.00"
    Option 3 "Blue" Value "3.00"

    Total: <Textbox Here>

    So if someone selects Box1 Option1 and Box2 Option3 Instantly the textbox value will become 8.00

    Anyone ever have experience with anything like this?

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Thanked 63 Times in 63 Posts
    JavaScript not Java...
    That said, guess you realized you posted in the wrong section

    In any case, here's an example that will help you achieve that: http://www.webdevelopersnotes.com/ti...tion_list.php3

    Use that to get the selected dropdown values, add the values (still using JS) and then print them back to the screen (google "javascript set textbox value" or something like that).


    Posting Permissions

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