Skip Navigation

[Gelöst] The placeholder is shown without code for the placeholder?

This support ticket is created vor 1 Monat, 1 Woche. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 5 Antworten, has 2 Stimmen.

Last updated by Nigel vor 1 Monat.

Assisted by: Nigel.

Author
Artikel
#2688996

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 🙂

Hope you can help?

Cheers
Marco

#2689055

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Marco

The placeholder and the required setting in the form are inherited from the custom field setting.

Go to Toolset > Custom Fields and locate the field group containing the field and update the settings there.

#2689448

hi Nigel,

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?

Cheers
Marco

#2689459

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Marco

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.

See https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

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.

#2689470

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.

Cheers
Marco

#2689481

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

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

			$capture = '<div id="recaptcha_' . esc_attr( $data['id'] ) . '" class="g-recaptcha" data-sitekey="' . esc_attr( $this->pubkey ) . '"></div><div class="recaptcha_error" style="color:#aa0000;display:none;">' . __( 'Please validate reCAPTCHA', 'wpv-views' ) . '</div>';

So you should be able to locate the string within the textdomain 'wpv-views' for translation.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.