-2

I have a dropdown list containing width values:

  • val1
  • val2
  • val3
  • all

And I also have three checkboxes:

  • val1
  • val2
  • val3

The checkboxes are responsible for a progress bar, all of them have an onclick function and they are working well. I want to make them work when I use the dropdown list too but I can't. So when I select a value from the dropdown list it modifies the checkboxes checked attribute but has no effect on the progress bar and I don't know why.

Manish Mishra
  • 12,163
  • 5
  • 35
  • 59
csaron92
  • 1,035
  • 2
  • 10
  • 20
  • 2
    Show your effort. Add the code that you have tried. – Code Lღver Apr 05 '13 at 07:12
  • You should trigger an event manually, check this post: http://stackoverflow.com/questions/2490825/how-to-trigger-event-in-javascript – Dfr Apr 05 '13 at 07:13
  • "I want to make them work when I use the dropdown list too".. I guess some part of the picture is still inside your head and definitely not here – Manish Mishra Apr 05 '13 at 07:15
  • Please just a suggestion for the future post. Whenever posting any question on the SO, please do also post the HTML markup and the code that you have tried. That would help us to provide better answers! – palaѕн Apr 05 '13 at 07:20
  • This is a real problem. I have no permission to post the real code. The question is, how can I manipulate a progress bar with checkboxes which are checked or unchecked with jQuery (through a dropdown list)? – csaron92 Apr 05 '13 at 07:36

1 Answers1

1

If you are using jQuery (as you are, according to your tags), set up an event handler for the change event. But you must trigger the change event manually, since you change the value programatically.

Some information for the manual triggering of the change event see this question

Community
  • 1
  • 1
Michael Rose
  • 7,770
  • 3
  • 22
  • 26