0

I have a dropdown list. On selection of the list a value changes. But the value of the progress bar does not changes.

For example: On loading of page the value should be 415760 (100% full Progress bar)

On selection of 9, the value should be 300000 (72% of progress bar)

On selection of 11, the value should be 0 (0% of progress bar)

Here is the code: http://codepen.io/neonirav/pen/qlgCD

Thanks.

3 Answers 3

1

set the value of your progress bar! by default value='0' a number, not a string as you did.

 <progress max="415760" name="gm_ro_total" id="gm_ro_total" value='0'></progress>

Then change

var gm_ro_total = parseInt(gmro1.value);
gm_remainingoil.innerHTML = gm_ro_total;

with

var gm_ro_total = parseInt(gmro1.value),
    gm_ro_totalElement = document.getElementById('gm_ro_total');
  gm_ro_totalElement.value= parseInt(gm_ro_total);
gm_remainingoil.innerHTML = gm_ro_total;
Sign up to request clarification or add additional context in comments.

4 Comments

This answer is correct. But, I am stucked again in further work. Here is the code: codepen.io/neonirav/pen/okdmC : where I stucked for the progress bar of the Total of the 2 or more things. From viewing the code you will be able to understand where is the error. Please help.
Consider accepting my answer please! your last line should be gmroprt.value = gm_ro_total; see this cdpn.io/okdmC
Is it possible to make 2 values for the same drop down working like the following excel sheet. docs.google.com/spreadsheets/d/… On this drop down code of the earlier one. Only value of time remaining to be displayed. codepen.io/neonirav/pen/jnvmd Thanks in advance!!
Sorry but I dont understand your last question! Please try to be clear
1

I have forked your code pen with what I think you need:

http://codepen.io/anon/pen/djhnk

You were setting .value on a div, not on the progress bar element.

1 Comment

Your answer is perfectly correct. But, I was am stucked again in further work. Here is the code: codepen.io/neonirav/pen/okdmC : where I stucked for the progress bar of the Total of the 2 or more things. From viewing the code you will be able to understand where is the error. Please help.
0

You should set value for Progres bar and not the div. Is this what you need? Code Click here to view

1 Comment

this is not an answer, you should post in OP question comment

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.