Saltar navegación

[Resuelto] Form with custom field taxonomy dependant

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 2 respuestas, tiene 1 mensaje.

Última actualización por Minesh 2 weeks, 2 days ago.

Asistido por: Minesh.

Autor
Mensajes
#2842160

Hi all and Happy New Year !

I am trying to do the same as specified here
https://toolset.com/forums/topic/conditional-logic-in-post-form/
https://toolset.com/forums/topic/form-add-new-content-with-custom-field-taxonomy-dependant/

which are said to be working, but not in my case.

In an add new content form I have a taxonomy field and I'd like to show another field conditionally if a certain value is selected in the taxonomy field, like this:

<div class="form-group">
		<label for="%%FORM_ID%%_instrument">[cred_i18n name='instrument']Instrument type[/cred_i18n]</label>
		[cred_field field='instrument' force_type='taxonomy' output='bootstrap' display='select' single_select='true' default_label='--- PLEASE SELECT ---']
</div>
[cred_show_group if="( $(instrument) eq 'Pedal AAA' ) OR ( $(instrument) eq 'Pedal BBB' )" mode="fade-slide"]
	<div class="form-group">
		<label for="%%FORM_ID%%_pedaltype">[cred_i18n name='pedaltype']Pedal type[/cred_i18n]</label>
		[cred_field field='pedal-type' output='bootstrap' display='select' single_select='true' default_label='--- PLEASE SELECT ---']
	</div>
[/cred_show_group]

Everything seems ok according to your indications in the old posts, but the field doesn't show if the Pedal AAA or Pedal BBB are selected.

Could this happen because the instrument taxonomy is hierarchical and values Pedal AAA and Pedal BBB are children of another parent item ?

Thanks in advance
Nicola

#2842233

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL where you added the form as well as admin access details and let me check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2842382

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Can you please check now: enlace oculto

I've adjusted the cred_show_group conditoinal code as given under:

[cred_show_group if="( $(instrument) eq '350' ) OR ( $(instrument) eq '403' )" mode="fade-slide"]
	<div class="form-group">
		<label for="%%FORM_ID%%_pedaltype">[cred_i18n name='pedaltype']Tipo pedale <span class="ast-obbl">*</span>[/cred_i18n]</label>
		[cred_field field='pedal-type' output='bootstrap' display='select' single_select='true' default_label='--- SELEZIONA ---']
	</div>
[/cred_show_group]

As you can see we are checking against the term ID instead of term title and I can see it working as expected.