Drop Down Counter

Hello all,
I am trying to make a button that will create or delete a drop down counter and I have the counter code figured out but not the buttons idealy what I would like is to be able to drop some code into a tiddler that when viewed would put a drop down counter in place and if I need 3 i hit the + button 3 times and if i am done with that counter i can click the - sign and remove that counter. I dont know if that is possible to do but thought I would ask. I love this community and I love tiddlywiki!

Thrugar

Counter 1<br>
<$select tiddler="MyTiddler" field="selectedNumber">
    <$list filter="[range[0,100]]">
        <option><<currentTiddler>></option>
    </$list>
</$select>
  • Edited to wrap code in three back ticks by TW_Tones

I would love to help, but I dont understand the question.

  • What is a drop down counter and what does create or deleting it mean?
  • Also it seems rather than putting code into the tiddler you would be best displaying it on tiddlers via a tiddler with the $:/tags/ViewTemplate tag.
    • Within this tviewtemplate tiddler there would be a condition when to display the add counter, and when to display the counter code, and delete counter to be displayed on tiddlers.

TW_Tones.
The code i provided makes a counter you can click on it and choose a number between 0 and 100.
What I am looking to do is to be able to make multiple counters upon request. i.e if I wanted 3 counters that each counted to 100 I could press a “+ button” 3 times to make 3 counters. If I created say 5 counters I would like to delete the extra 2 I created by accident. or any other simple method of making more counts or removing them once created, if they are not needed.
I hope this explains it better I am sorry if I did not explain it well enought the 1st time. Thank you for your assitance it is very much appreciated.

Thrugar

If the counters are stored in fields on the current tiddler, each click of a + could simply create counter-1 counter-2 etc … fields. Then something on the view template can discover that the fields counter-* exist and for each provide a counter button set. including a button to delete the current counter-N field to remove it.

Alternativly one could use the suffix -counter for each field and use what comes before the suffix as the name of the counter eg visit-counter = the visit counter.