Must be greater than function

Hello There,

I am trying to build a custom form for people to be able to upload properties onto my website.
On the form, I need to force people to enter a number in one field greater than the number in the next field (to be precise, I have a “minimum stay” and a “maximum stay” field and the maximum stay must be greater than the minimum stay).

How do I go about setting it up in my wix code?

Thanks in advance!

Hi Freddy,
You could accomplish that validation during the actual input process by coding in the onKeyPress() event of the involved object. In this event you can CANCEL the invalid input key before it even gets displayed.

Other way to do that is to allow the user to input any value and do the validation when the object loses the Focus by using the onBlur() event or also during the submission process.

Hope this helps,
-Luigi

Hi Luigino,

Thanks for the tip! On it now…