Forums › Forums › General Questions › How to set automatically the percentage of the progress bar block
-
How to set automatically the percentage of the progress bar block
-
Hi,
I am using the progress bar block and I need to automatically update the progress percentage based on input data entered in other blocks. The problem I have is that I don’t know how to set the value of the percentage field. I have seen that the field identifier containing the percentage is dynamically created as ‘#inspector-input-control-i’ with i variable.
I have been testing with these js scripts attached below but have not been successful.
Can you help me with the script that I should use to set the percentage automatically?
Thank you very much and congratulations for the great plugin !!
jQuery(document).ready(function($) {
$('body').on('change', function() {
$('body').find('input.components-input-control__input.css-h7hvkg-Input.e1cr7zh12.inspector-input-control').val('my-value');
});
}
jQuery(document).ready(function($) {
$('body').on('change', function() {
$('body').find('inspector-input-control').val('my-value');
});
}
Log in to reply.