'Selecting a role in Wordpress. UserPro

At the moment, I am busy creating a registration form in Wordpress, with the UserPro plugin. Almost everything is working fine. Except for one thing, which is selecting a user role that you want to register with. The form has a dropdown menu in which the user can choose between two options. Either a dj or a radiostation.

I have added two new user roles with the help of the User Role Editor plugin. The roles are called "DJ" and "Radiostation". The role id's are "dj" and "radiostation". I have permitted the roles to register. Yet, when I want them to register, the following error appears:

Error in jQuery.ajax while submitting a form: You are trying to register with a non-valid role.

I Googled how I can fix it. However, the only solution I found is that I have to permit these roles to register. I have already done that:

As you can see, dj and radiostation are two roles that have permission to register.

I hope you guys can help me out, I have been working on this error for the past few days.

I could not find any questions similar to mine here on StackOverflow. Hopefully, I have given you enough information for you to help me out.

Greetings,

Parsa



Solution 1:[1]

Image for reference of the fields

After a successful registration Update User Role After admin approval Default Role for New Users

Make sure that these 3 fields from above have the same role selected.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Joymen Rebello