Additionalsignupfield for phone and date

how to add option for number and date? And icon not working when i upload
additionalSignUpFields: [{
name: “first_name”,
placeholder: “Enter your first name”,
//icon: “https://longinhq.com/wp-content/images/png/user.png”,
},
{
name: “last_name”,
placeholder: “Enter your last name”,
//icon: “https://longinhq.com/wp-content/images/png/user.png”,
},
{
name: “date_of_birth”,
placeholder: “Enter your date of birth (12-02-2000)”,
//prefill: “12-02-2000”,
//icon: “https://longinhq.com/wp-content/images/png/user.png”,
/validator: function(date_of_birth) {
return {
valid: date_of_birth.value = int,
hint: “Must have 10 or more chars” // optional
};
}
/
},
{
name: “billing_phone”,
placeholder: “Enter your phone number”,
//icon: “https://longinhq.com/wp-content/images/png/user.png”,
/validator: function(billing_phone) {
return {
valid: billing_phone.value = int,
};
}
/
}]
});

Hi @LonGin,

Unfortunately, the date and phone number is not currently supported by additionalSignUpFields, but you can use the validator function like you are using now.

Something like:

      additionalSignUpFields: [{
        name: "first_name",
        placeholder: "Enter your first name",
        icon: "https://longinhq.com/wp-content/images/png/user.png",
      }, {
        name: "last_name",
        placeholder: "Enter your last name",
        icon: "https://longinhq.com/wp-content/images/png/user.png",
      }, {
        name: "date_of_birth",
        placeholder: "Enter your date of birth (12-02-2000)",
        placeholder: "12-02-2000",
        icon: "https://longinhq.com/wp-content/images/png/user.png",
        validator: function(date_of_birth) {
          return {
            valid: Date.parse(date_of_birth),
            hint: "Please enter a date (12-02-2000)"
          };
        }
      }, {
          name: "billing_phone",
          placeholder: "Enter your phone number",
          icon: "https://longinhq.com/wp-content/images/png/user.png",
          validator: function(billing_phone) {
            return {
              valid: (billing_phone.match(/\d/g) || []).length == 10,
              hint: "Please enter 10-digit phone number"
            };
          }
      }]
    });

The best option for you may be to redirect to another page during login using a redirect rule to collect additional data during sign up, following the pattern used for tracking consent – GDPR: Track Consent with Lock

I try using redirect rule but nothing happend after click submit…do i need put any code on submit button
?

Hi @LonGin,

I took a look at your rule from our internal tools, and it looks correct to me. You won’t need to add any code to the submit button. One thing to check would be to double check that the rule is enabled: