Hi all,
I’m relatively new to Weweb and am running into an issue with conditionally required fields in my sign up form. I have a field to input a phone number that conditionally appears based on whether the user opts in to receive text alerts. The text alert opt in is optional, but I want to make the “phone number” input required when the user opts in. See below for a visual of what I mean:

In Weweb, I binded the phone number field to be required when the checkbox is ticked. However, when I test the sign up page by leaving the phone number field blank, no error occurs and it signs the user up with a 0 in the corresponding phone number field in Xano.
Has anyone run into a similar issue? In Xano, the phone number field type is integer, so I’m guessing the 0 that Weweb sends to Xano when the field is blank counts as a valid response?
See below for my conditionally required formula in Weweb (one note - I changed the input type to short answer vs phone when trying to troubleshoot, but couldn’t get it to work for either input type):
Side note: I tried to include this photo in my original post, but got an error message saying that new users can only include one embedded media item in their posts?
where is the workflow to sign up the user? You need to use a form container and add the workflow with the submit trigger of the form to use the browser validation of inputs. As an alternative you can implement your own validation logic in the workflow.
Here’s my workflow. Everything is within a form container. How would I go about building my own validation?
with if else switches in the workflow where you can bind the true/false value to any formula that checks your logic
Got it, I’ll try that. Thanks for the responses - I appreciate the help!
1 Like