This example for the Counter Object is pretty cool! My question is…
How do you set up text to update when the value increases? In the example, it shows "Counter Value."
https://docs.pubcoder.com/pubcoder_counter_object.html
This example for the Counter Object is pretty cool! My question is…
How do you set up text to update when the value increases? In the example, it shows "Counter Value."
https://docs.pubcoder.com/pubcoder_counter_object.html
Hi Tony,
I think it uses several text boxes on an ascending order. Only “1” is shown and the beginning, the remaining are hidden. Each text box is cued by an individual counter.
Does it make sense? Other ideas are welcome.
Terry
Hello Terry,
we provide a javascript function to get the value of the counter and another to switch the text of the object dynamically:
https://docs.pubcoder.com/pubcoder_code.html
Thanks Angelo. Yes I bet JavaScript will do the work. To someone who don’t know how to code like me, I can only make weird interactions from the resources available. :-p
I have the same question and found this thread in hopes to find the answer. Angelo, the answer you provided is confusing, at least for me:
https://docs.pubcoder.com/pubcoder_code.html
I went to that link and found an entire post about the entirety of what the code is in PubCoder. I don't see an answer to Tony's question. Is there a code snippet we need to access? What is the line of code?
I opened up the example that comes with PubCoder, I found this:
https://ibb.co/dtcvnR9
I'll echo Tony's original question. How do you show the Counter value? How do you reflect a change on an object when a counter is updated?
For an example, if the counter goes to "1", how do we reflect an image to show "1"? When the counter goes to "2" how do we show the number text box show "2"... and so on.
I looked at the example, looked at interactivity, I could not find where the code is at that tells the text box to change. I tried to look at the code/javascript and all I see is an empty window.
If all else fails I'll use Terry's suggestion. There might be a more efficient option, but at least Terry has an understandable way to get it to work. I have no idea what to do with the link Angelo provided before. It got overwhelming.
Hello James,
this is the right section:
https://docs.pubcoder.com/pubcoder_code.html#custom-javascript-code-and-pubcoderjs
to get the value of a counter object "obj6262", you can use pubcoder.getCounterValue($("#obj6262")) but I strongly suggest to read the entire document to understand how to proceed.