Skip Navigation

[Resolved] Custom Field Numeric Min/Max Range

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 4 replies, has 2 voices.

Last updated by Cory 1 year, 7 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2621115

When creating a new Numeric Field, I'm trying to find a way to only allow a specific range into the field. For example one of my numeric fields can only have a range of 0 to 5. I see the option to hide the display with conditions, but I don't see any place where I can prevent numeric inputs from a specific range?

Thanks~

#2621127

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for your contact.

Just to make sure, are you trying to set this min and max range for a numeric field in the backend or in the frontend?

In the backend I'm afraid we would have to apply some code customization, but in the frontend it is possible to do a condition like this, for instance: https://toolset.com/forums/topic/filter-by-a-range-between-2-values-minimun-maximun/#post-915135

Please let us know this info, so that we can check better the options we'd have for it. Thank you.

Kind regards,
Mateus.

#2621177

Hey Mateus,

Thanks for the quick response! Yeah I need code for the backend in the wp-admin on a repeating group numeric input field. My admins occasionally enter in wrong values from other fields so I need to make sure I can validate their input. Can you provide me with some backend code?

Thanks

#2621441

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for the clarifications.

There is no easy solution when working in the back end, I'm afraid. It'd be needed to add a PHP that would enqueue a JavaScript only on the relevant pages, and that JavaScript would modify the relevant inputs, perhaps changing the input type to number and adding min and max attributes. For instance: hidden link.

At this point - and since code customization is beyond of the scope of this support forum, the adequate approach is to consult with one of your certified partners-developers, please take a look here: https://toolset.com/contractors/

Note: the possible solution provided is to be used just as an informational one. Please remember that custom coding is out of the scope of our support, so we can't create, debug or modify code for you and it's your responsibility to maintain it. We hope the one we used as an example could point you in the right direction. Please check our support policy: https://toolset.com/toolset-support-policy/

Thanks for your understanding. If you need anything else don't hesitate to contact us.

#2621477

Thanks for the feedback!

I'll take a look at that link and see if I can come up with a custom solution. It does look like your competition provides this out of the box...
hidden link

Maybe this is something your development team can look at in the future?

Cheers~