Skip navigation
Currently Being Moderated

How to get total value from checkbox list?

Apr 23, 2012 10:05 AM

Tags: #add #numbers #total #web_apps #adding_data

I have a list of checkbox items - all number values. I want to then get the total value from all of the check items and add that value to the database. Can this be done?

 

Also, anyone know of one source where I can get detailed information on how to best use Web Apps and all of it's possibilities and limitations? Most of the tutorials that I have seen so far say that you can do most anything with Web Apps; however, the tutorial examples leave a lot of questions unanswered. I saw that Adobe has an article that shows how to build a basic web app and that it is "part 1" in a series. Anyone know where to find parts 2, 3, etc?

 

Thanks,

 
Replies
  • Currently Being Moderated
    Apr 23, 2012 4:31 PM   in reply to ManOfLeisure77

    Hi there,

     

    Good day, i hope this will give you some ideas

     

    for example this is your html

     

    <input type="checkbox" name="test" value="1">1

    <input type="checkbox" name="test" value="2">2

    <input type="checkbox" name="test" value="3">3

    <input type="checkbox" name="test" value="4">4

     

    and this is your jquery script

     

    <script type="text/javascript">

    jQuery("input@[name='test']").click(function() {

        var istrue = jQuery(this).is(":checked");

        if(istrue == true) {

            var urvalue = jQuery(this).val();

            alert(urvalue);

        }

    });

    </script>

     

    hope this helps you

     
    |
    Mark as:
  • Liam Dilley
    6,719 posts
    Feb 28, 2012
    Currently Being Moderated
    Apr 23, 2012 4:38 PM   in reply to khyrainebcdev

    Needs to be more then that through hey,

    It also needs to run onChange as well to cover someone changing their mind.

    You also neeed a hidden custom field on the form to output the result so it comes through to the form.

    I will see what I can whip up later today if no one has given you an example to cover all your requirements

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points