Slider with fixed values

By: Roberta Cerami | Asked: 08/06/2023
ForumsCategory: Code HelpSlider with fixed values
Roberta Cerami asked 9 months ago
Hi, I need to add a slider with fixed values (for example 1,20,34,58,etc)  How can I do that? Thanks
1 Answers
Victor Font answered 9 months ago
No. The Slider is a range field. You can apply minimum, maximum, and step values. A step value is the granularity between values. You can't have a step value with an inconsistent granularity. You can however create your own custom field that offers the features you want. You'd have to create a custom field add-on.
Roberta Cerami replied 9 months ago

which add on? I can't find it

Victor Font replied 9 months ago

Which add-on? None. “Create your own custom field” means you write the custom code yourself or hire a developer. It’s a completely custom solution.

Roberta Cerami replied 9 months ago

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range. the range field give a way to add a list of value, but this is not present in Formidable form.

Victor Font replied 9 months ago

I tested the Mozilla solution and did not get it to work with Formidable. BTW, you can add any attributes you want to an input field. Navigate to the form's customize HTML page and add list="id" to the input shortcode for your field. It will be available as an input property in the rendered HTML.

Roberta Cerami replied 9 months ago

[field_name]
[required_label]

[input list="id" ]
[if description][description][/if description]
[if error][error][/if error]

But nothing is. available in the input property

Victor Font replied 9 months ago

I don't know why it's not working for you. This is the way you add additional properties to an input field. https://formidableforms.com/knowledgebase/customize-html/#sts=Add%20custom%20input%20attributes

Don't forget, in the example you provided from Mozilla, the datalist has an id of "values". When I tested this in my dev environment. I was able to see the tick marks and values, but the field was not formatted correctly.

As an FYI, I would have used radio buttons and would have disguised them as a slider with CSS/jQuery.

Roberta Cerami replied 9 months ago

My problem is I'm not able to add custom field type because there is always js to add.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right