0

I would like to know how I can set values for each checkboxs. For example: I have 2 checkboxes, and their values will be:

Checkbox One: 1
Checkbox two: 16

If I select Checkbox One + Two I'll update my input value for: 17. But If I uncheck checkbox two, the value will update to 1 and vice-versa.

I made this, months ago...But I lot when I format my computer, I already do something like in C#, but i need to do the same in Web.

I don't want a full source-code, I just want tips that how I can handle this.

1
  • "tips"? use jquery selectors and jquery events? Commented Jan 8, 2016 at 22:31

1 Answer 1

1

just set the value attribute of each checkbox to the value you want, use a jquery selector to get all the checked checkboxes, and use a $.each to sum the checked values.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.