Skip Navigation

[Résolu] [cred_show_group] not working in relationship form

This support ticket is created Il y a 4 années et 10 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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+00:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par kaneB Il y a 4 années et 10 mois.

Assisté par: Nigel.

Auteur
Publications
#1455677

I want to show/hide a custom field in a relationship form (for an intermediary post type in many-to-many relationship) based on the selection of another custom field in the same setting. [cred_show_group] does not seem to work and is displaying the shortcode as text on the front end.

[cred_show_group if="($(asset-movement-type) eq 'Issue Out')"  mode='slide']	
	<div class="form-group">
		<label>Asset Issue Date</label>
		[cred-relationship-field name='asset-issue-date']
	</div>
[/cred_show_group]

Can I use this shortcode in relationship form? If not what is my alternative to achieve the same?

#1456073

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Screenshot 2020-01-13 at 13.10.03.png

When editing a Relationship Form with the visual editor you'll notice that the section to add a conditionally-displayed group which is normally available (see screenshot) is missing: there is no support for conditional field display in relationship forms.

You can request it be added: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

That won't help much right now, though. If you want such functionality you would need to build it yourself with some JavaScript/jQuery.

Use the DOM ready event to hide the section you want to conditionally display.
Add an event listener to detect changes in the input for the field which would trigger the display and use it to toggle the visibility of the hidden section.

#1459177

Alright noted. I have logged a feature request. Nothing can be done now.