Can we make validation for field which will not accept negative values ?

  • Abhilash12
    Asked on July 27, 2016 at 12:03 PM
  • Support_Management Jotform Support
    Replied on July 27, 2016 at 1:11 PM

    You have 2 options to choose from:

    1. Use Conditional Logic - IF its VALUE is LESS THAN 0, THEN do something (e.g. hide the submit button, show an error, etc.)

    Here's how I setup the Condition:

    Can we make validation for field which will not accept negative values ? Image 1 Screenshot 20

    Here's a related guide on how to setup Conditional Logic [GUIDE: Smart-Forms-Using-Conditional-Logic] 

    2. Use Input Mask - This will only be applicable if you know the number of digits of the field in question beforehand (e.g. your field only requires 2 digits - 23, 56, and so on). You may then set the Input Mask of the field to ## so it only accepts 2 numbers (no negative sign prefix).

    Here's a related guide on how to setup Input Masks [GUIDE: Getting-Started-with-the-basics-of-Input-Masking] 

    This is a demo form https://jotform.com/62084737125961 showing both approaches. Feel free to clone it so you can see how the condition and input mask were setup [GUIDE: How-to-clone-an-existing-form-from-a-URL] 

    I highly recommend you take a peek at the links I included on this thread. Give it a whirl and if you're stuck on something, let us know we can further help.