Discourse Authentication Validations

It is currently impossible to have an optional required field.

I have a field “Industry” and whenever “Other” is being selected, it unhides the “Other Industry” field.

But when I make the “Other Industry” field required, I am unable to submit the form when that field is hidden.

When I manually unhide the div you can see that it is requiring this input, even though the form is hidden.

When I select “Other”, fill in a value, and then select another industry so the input becomes hidden again, I can submit the form. And then also the same situation happens as @kravitsjacob pointed out: the value of the “Other Industry” field is saved to the users profile, even though “Industry” is not set to “Other”.

User Admin:

3 Likes