How to make one of two fields required, but only one filled

  • Profile Image
    art_crate
    Asked on June 21, 2016 at 12:46 AM

    Hello,

    I need to be sure that a customer chooses either a set price or puts in a custom price. How do I make it required that one of them is filled before clicking next.

    *** Also if someone clicks a set amount (ex: $200) but then tries to put in a custom amount, how do make it so one one is entered.

  • Profile Image
    liyam
    Answered on June 21, 2016 at 02:06 AM

    Hello,

    The best way to address your concern is:

    1) Add an 'Other' value in your widget and then
    2) Add a show/hide condition in your Custom Amount field that it will only show up when the Other value is selected.

    At the same time, both fields should be set as required. The hiding of the field will prevent the enforcement of its requirement, so the functionality of the required function will only happen once the field is revealed.

     

    By doing this method, it will make the user only choose an exact value based on the selections, or choose the Other and let them fill their preferred value. 

    Please let us know if you have questions.

    Thanks.

  • Profile Image
    art_crate
    Answered on June 21, 2016 at 02:26 AM

    Thanks Iiyam that seemed to do the trick!