We can change the value of the progress bar by connecting with different events. To understand how to work on this we will keep two buttons one is to increment the progress bar and other is to decrease the value of the progress bar. We will be using Click event of buttons to trigger the changes in value.
Enable or Disable progress bar
Based on our condition we can enable or disable our progress bar.
$("#progress_bar").progressbar( "enable" );
$("#progress_bar").progressbar( "disable" );
Here is a script where can enable or disable progress bar based on the condition of a checkbox.
Counting number of chars entered by user
You can see one example on counting the number of characters entered by user inside a textarea and the same can be reflected by a progress bar.