# Optional select in Classic Universal Login additionalSignupFields?

**URL:** <https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [June 5, 2023, 4:31pm UTC](https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573 "2023-06-05T16:31:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sinclair.kinch](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@sinclair.kinch](https://community.auth0.com/u/sinclair.kinch)\
**Post date:** [June 5, 2023, 4:31pm UTC](https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573/1 "2023-06-05T16:31:18Z")

</div>

Hi Auth0 team, in Classic Universal Login additionalSignupFields, is there any way to make a select field optional? I see that the validator on text fields can make them optional, but I can’t figure out how to do it for a select.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 5, 2023, 7:24pm UTC](https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573/3 "2023-06-05T19:24:28Z")

</div>

Hi @sinclair.kinch,

Welcome to the Auth0 Community!

> [@sinclair.kinch](#):
>
> in Classic Universal Login additionalSignupFields, is there any way to make a select field optional? I see that the validator on text fields can make them optional, but I can’t figure out how to do it for a select.

Yes! If you require the `additionalSignUpFields` to be optional, you will need to update the validator for the field to always return `true`.

See below of an example.

```auto
additionalSignUpFields: [{
  name: "Company",
  placeholder: "Company",
  icon: "https://example.com/assests/address_icon.png",
  validator: function(company) {
    return {
      valid: true
    };
  }
}]

```

I hope this helps!

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![sinclair.kinch](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@sinclair.kinch](https://community.auth0.com/u/sinclair.kinch)\
**Post date:** [June 5, 2023, 7:35pm UTC](https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573/4 "2023-06-05T19:35:35Z")

</div>

Hi @rueben.tiow, thanks for your response. I’m asking about a field with `"type": "select"`. It appears not to accept a validator, so I’m wondering if there’s a way to make a select field optional.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 5, 2023, 9:53pm UTC](https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573/5 "2023-06-05T21:53:34Z")

</div>

Hi @sinclair.kinch,

Thank you for your reply and clarification.

Ah, yes, I missed an important detail that it was the select field and not a text field. My apologies for that.

In this situation, unfortunately, the select field is non-optional. When the user tries to sign up, there will already be a default value selected. Let’s take a look at this example:

```auto
  additionalSignUpFields: [{
    type: "select",
    name: "location",
    placeholder: "choose your location",
    options: [
      {value: "us", label: "United States"},
      {value: "fr", label: "France"},
      {value: "ar", label: "Argentina"}
    ],
    // The following properties are optional
    icon: "https://example.com/assests/location_icon.png",
    prefill: "us"
  }]

```

In the code above, the default value selected would be “United States,” which would not require the user to select a choice.

As a workaround, you could include an additional “None” value as the default value so that it mimics an optional select field.

I hope this helps!

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 19, 2023, 9:53pm UTC](https://community.auth0.com/t/optional-select-in-classic-universal-login-additionalsignupfields/108573/6 "2023-06-19T21:53:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
