CalcBuilder Forum

setting conditional upper and lower limits of a number field

Usuario adk 2018-11-08 10:32:42

We calculate a price for a product with two configurations : config1 and config2 (option list field).

After the choice of the configuration the customer has than to give in a value of the width of the product in millimeters (number field).

For config1 the lower limit of the width is 1000 mm and the upper limit 4000 mm.
For config2 the lower limit of the width is 2000 mm and the upper limit 5000 mm.

Can this be set in the form fields so that the customer gets a warning when he choses a width which is not possible depending on the configuration he has chosen.

So with other words : is it possible to set conditional upper and lower limits of a number field based on a option list?

Regards,
AdK

Moonsoft support 2018-11-09 09:37:02

Hi,
that kind of specific validation is not configurable as default, but if you have some knowledge of javascript, you can extend the validator and add this special function to your field. At this tutorial entry you'll find detailed instructions and a working example on how to add custom validators to any field:

https://www.moonsoft.es/easyblog/entry/23-code-tip-add-custom-validation-to-form-fields

Hope this helps, regards

Usuario adk 2018-11-10 11:09:16

Thanks for the reply.

Unfortunately I do not have any knowledge of Javascript but I will give it a try and I will study your tutorials thoroughly.

Before I start with your Calc Builder I did not have any knowledge of PHP but it goes quiet well so why not with Javascript.

Regards,
AdK

Moonsoft support 2018-11-12 09:38:41

Hi,
ok, you can give it a try and we can send any quick tip if you get stuck. In case you need to build any more complex code, please note we also have a custom calculator service, for which we can fully configure the calculator for you including any custom function needed. If at any time you want to ask for a quote you can use the private helpdesk in order to send your requirements.

Regards

...
List Manager

Build different lists for your site

Buy now!
...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!