Skip Navigation

[Resolved] Dynamically Populate Custom Fields depending on another custom field

This support ticket is created 6 years, 3 months ago. 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
- 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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 6 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1093292

Hi

I have a view where I have a custom field Country and conditional display for states depending on what's selected at the country level.

This dynamic population of states works fine in CRED Forms but doesn't populate in views. This is what I have in views:

<div class="form-group">
<label>[wpml-string context="wpv-views"]Country[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-country" url_param="wpv-country"]
</div>
[wpv-conditional if="( $(wpcf-country) eq 'UK' )"]<div class="form-group">
<label>[wpml-string context="wpv-views"]UK[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-uk" url_param="wpv-wpcf-uk" output='bootstrap']
</div>[/wpv-conditional]

[wpv-conditional if="( $(wpcf-country) eq 'Australia' )"]<div class="form-group">
<label>[wpml-string context="wpv-views"]Australia[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-australia" url_param="wpv-wpcf-australia" output='bootstrap']
</div>[/wpv-conditional]

How can I have UK or Australia states populated depending on the country selection? They work fine in CRED Post form.
They have been correctly set in the custom fields.

Thanks

#1093716

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - actually - there is no way to display dependent field with views filters.

However - you can show/hide it the field based on the dropdown value selection by adding custom jQuery code to your view's search and pagination section's JS box.

If you can share problem URL and access details - I would be happy to help you further. Please share what you want to show/hide based on what selection.

*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

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