Saltar navegación

[Resuelto] The placeholder is shown without code for the placeholder?

This support ticket is created hace 1 año, 1 mes. 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.

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)

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por Nigel hace 1 año, 1 mes.

Asistido por: Nigel.

Autor
Mensajes
#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 enlace oculto. 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
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: 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
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: 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" enlace oculto. It is not in the message list and not in the language file of toolset forms. I use loco translate.

Cheers
Marco

#2689481

Nigel
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: 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.