Hi,
I am editing a user from. There are a lot of changes thru the last time. Now I decided to delete the placeholders. But they are still shown? A part of the form is this:
<div class="form-group col-md-3">
<label for="%%FORM_ID%%_voorletters">[cred_i18n name='voorletters-label']Voorletters[/cred_i18n]</label>
[cred_field field='voorletters' force_type='field' class='form-control' output='bootstrap']
</div>
It will show this hidden link. Isn't it strange?
And can you give me the js code again for making things required in a user form? I lost it 🙂
Thanks for that support. Somtimes I am searching to deep :-). Now for the fields of WP like lastname:
<div class="form-group col-md-12">
<label for="%%FORM_ID%%_last_name">[cred_i18n name='last_name-label']Achternaam[/cred_i18n]</label>
[cred_field field='last_name' class='form-control' output='bootstrap']
</div>
How can I make them required?
For fields other than Types fields you would need to use the Forms API, specifically the cred_validate_form filter, to validate entries, including making fields required.
All of the form fields are included in the data provided by the hook, so that you can check whether they have values or not, and set an error if they are missing.
Woowh, I have to dive into this. Thanks. Last question about a form. Where can I translate this "Please validate reCAPTCHA" hidden link. It is not in the message list and not in the language file of toolset forms. I use loco translate.
I'm not familiar with loco translate, so I don't know what it can or cannot do.
But checking the source code of Forms, the string *is* registered via a gettext call in wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.recaptcha.php