Hello,
I need some help with my subscription form… I understand how it works and I was able to do it very quickly. However in the meantime things have changed and now it’s getting a little bit more complicated… Let me explain :
I have a form with standard fields such as firstname, lastname, e-mail address, password + confirmation AND also a field name “Company” (and a checkbox to accept privacy policy).
All the fields are mandatory.
When the user clicks on the validation button, I need first to create the company, and then to create the user associated to the company. I did the workflow with no problem, but my issue is about the mandatory fields and the messages to display.
I added some text fields below each input (that says : this field can’t be empy), and I created some states such as “firstnameIsEmpty”, “lastnameIsEmpty”, etc.
When firstname get filled, firstnameIsEmpty gets false and the error message is hidden. If the user deletes the firstname then the variable get true and the error message gets displayed.
I don’t know if it’s the right thin to do, because when the pahe loads, all variables are initialised with “isEmpty” = true and therefore all error messages are displayed.
Could you please help me ? Am I doing the right thing with custom states ? Or is there a simpler way to do it ? And what should I do to no display the error messages on page load ? I alredy set the state to be “not displayed on page load” but as the custom states variables are false, they get displayed…
Thanks in advance for your help.
Regards,