Topic-icon Show error message for mandatory fields in registration

Active Subscriptions:

None
9 years 4 months ago - 9 years 4 months ago #60766 by socialemotional
I am not getting any error message when I don't fill mandatory fields at the SC Registration Component (while signing in via Linkedin).

It shows the mandatory fields (in my case only the password and repeat password), but if I press the register button and have not filled any of the mandatory fields, nothing happens and no error message is shown to tell the user something is not right.

How can I show an error message? what am I missing?
Last edit: 9 years 4 months ago by socialemotional.
The topic has been locked.
Support Specialist
If there's a page to test on, it would help narrow things down quickly. JFBConnect uses the form-validate tag on the form and the validate.js script from Joomla to mark any fields that aren't set with the proper CSS tag.

I believe the fields that aren't set properly will be updated with a class like the below:
class="required invalid"
It's up to your template to properly set a style for the 'invalid' class.

I hope that helps, but if not, please let us know where we can test and we'll gladly investigate further.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
Does that mean that it is only supposed to apply the style and not show any error message?

I can confirm that it applies the "invalid" class, so for this part I can style it.

My request then is to have some kind of text to tell the user that the input is required or invalid, is that possible?
The topic has been locked.
Support Specialist
9 years 4 months ago #60775 by mel

My request then is to have some kind of text to tell the user that the input is required or invalid, is that possible?

We don't have an easy way to do this right now. However, the following line of code is in plugins/socialprofiles/communitybuilder/communitybuilder.php around line 126. It adds a star to the field to show that it's required and could be modified to have more verbose text.
$required = ($cbField->required ? '<span class="star">&nbsp;*</span>' : '');

That combined with highlighting the input that's invalid should help do what you're looking for.

I've added an issue to our tracker to make the * a string in our language files.

-Melissa
The topic has been locked.
Active Subscriptions:

None
Thank you.

I'll give a try with your suggestion.
The topic has been locked.