Range selector for standard text box

Modified on Thu, Oct 7, 2021 at 10:07 AM

Add an ‘attribute’ command to any block of type textline with the following values:

type="range" min="50000" max="500000" step="100" value="250000"

Add ‘htmlbefore’ or htmlafter’ command to the block with the following value:

<output class="range-output " for="Inputxxxxx"></output>

Min, max, step and value can be set to preference.

The green xxxxx must be replaced by the actual Block ID. Example: Input12345

output classes: use any style, range-output will be used in the JS code later.  range-output can be changed provided it is changed in the JS code as well.

Add the following to the main  layout section:

<script>
const inprange = document.querySelector('#Inputxxxxx');
const outrange = document.querySelector('.range-output');
outrange.textContent = inprange.value;
inprange.addEventListener('input', function() {
outrange.textContent = inprange.value;
});
 </script>

Result:

Graphical user interface, text, application, chat or text message

Description automatically generated

 

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article