I want to insist that one of 2 fields is more than 0

  • tracyalexander
    Asked on April 26, 2017 at 1:14 AM

    I want to add a requirement that Number of Adult Memberships or Number of Child Memberships must be 1 before the user can submit.

    Can you please tell me how I do this.

    I have added a requirement that a field is shown with error text if both these fields show '0' but I think the user could still move on?

  • Ian
    Replied on April 26, 2017 at 4:05 AM

    Following settings for both the fields should fix the issue

    Keeping 0 as default value bypasses the mandatory validation as 0 itself makes the field non blank and passes value 0 while submission

    Change the limit entry from 0 to 5 to 1 to 5

    I want to insist that one of 2 fields is more than 0 Image 1 Screenshot 30

     

    I want to insist that one of 2 fields is more than 0 Image 2 Screenshot 41

    Hope this helps.

  • tracyalexander
    Replied on April 26, 2017 at 6:02 AM

    Hi Ian

    Will this allow one of the fields (Adult or Child) to remain with no value or zero?

  • Chriistian Jotform Support
    Replied on April 26, 2017 at 7:00 AM

    Hi there,

    Currently, both fields are required. If I understand it correctly that at least only of these 2 fields in question is required, you can add the following conditions to your form.

     

    I want to insist that one of 2 fields is more than 0 Image 1 Screenshot 30

     

    I want to insist that one of 2 fields is more than 0 Image 2 Screenshot 41

     

    Please read more about Smart Forms Using Conditional Logic

    Let us know if you need further assistance.

    Regards.