# How to restrict the range of a number linked to an input box?

I would like to inquire about how to restrict the range of an input box’s number?

I have searched the internet and found out that I should set the minimum and maximum of a number linked to the input box, as indicated in the following article:

https://help.geogebra.org/topic/input-box-range

In the past, this method worked well. But this method failed recently. I entered a number larger than the predefined maximum into the input box, and this number was accepted. I also found out that the maximum value of the variable was adjusted automatically (became larger) by the program so the input number now became legitimate.

I tried this on a desktop Windows version of the GeoGebra (Classic 6) and on an applet on my GeoGebra website. The link of the applet is attached for your easy reference: https://www.geogebra.org/m/xZQQN3kx

Many thanks for any assistance!

As a workaround, if a is the linked object, and you want its max value equal to a value n, you can use e.g.

in the OnUpdate script of the linked object.

I'm looping this post to the developers, thank you.

(Same behaviour also on ggb v.5 Classic)

To restrict the range,

create a variable for the max value of slider

Many thanks for your valuable advices!!

Loading...Comments have been locked on this page!