I’m trying to setup a custom registration form and I end up getting an unknown failure (404) error whenever I submit the form (Both Preview and Live Modes)
@shantanukumar847
ok so the agency issue was being caused as you did not have the correct field key, WIX CRM does not show you the correct field key when you use a space between names…they should fix that.
For labels you need to create a fieldKey called labels then you will be able to pass info to it. Note this will be a custom fieldKey not a label.
I believe I discovered the issue in your code regarding the label not being added. When you add labels via the wixUsers.register() API, it requires that you add them as an array . This allows you to add multiple labels, but even if you’re only adding one, it still needs to be in an array.
So your variable assignment should be:
let label = ["Seller"];
When I tried it using your code, I received a 400 error. Once I converted it to an array, it worked fine.
I admit it should handle this more gracefully, particularly because the error is not very specific. I’ll speak to the developers about this.
Anyway, please give this a try and let us know if that fixes the problem. Good luck!
Oh, I just noticed in the Wix Code Tutorial article on adding a custom registration form that the code places the square brackets inside the contactInfo object. It doesn’t matter which way you do it as long as you’re passing an array to the ‘labels’ key in the contactInfo object. HTH.
FYI I worked with one of our technical writers and he changed the example to make this all clearer, so hopefully no one else will be tripped up by it. Sorry for the trouble!