Skip Navigation

[Resolved] passing postmeta url param

This support ticket is created 5 years, 11 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by bryan 5 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#1193040
Screenshot 2019-01-30 20.07.51za.png
Screenshot 2019-01-30 20.07.42.png
Screenshot 2019-01-30 20.07.51z.png

is it possible to select one field in views but pass on a different custom field from the same post type to CRED for example

Select "Finland" but pass on to CRED only the country code "FI"
Select "Cambodia" but pass on to CRED the country code "KH"

[wpv-control-postmeta field="wpcf-country" type="select" url_param="wpv-wpcf-country"]

works fine but I really want to pass on a code not the name

eg I tried

[wpv-control-postmeta field="wpcf-country" type="select" url_param="wpv-wpcf-country-code"]

..but

longer explanation if needed.

Tell us what you are trying to do?
Conceptually - Use a dropdown of CPT fields list to populate a user form field

Is there any documentation that you are following?
https://toolset.com/forums/topic/passing-value-from-view-to-cred-form/

What is the link to your site?
I recreated a similar situation
hidden link - but one needs to be logged on to see it work (happy to supply details)

I might be going about this all wrong but --

I want to be able to select from a list (for example countries) which are actually a custom post type.. (we dont want two lists which get out of sync)

...and then pass one of the fields to a cred user form using a view search filter on one page then using the url param to pass from the view to a user cred form

This works well except I would like to be able to select from a full name like Finland - but pass on to cred ONLY a code.. e.g. FI which is in a different custom field

in my example I want to select

wpcf-country

but pass on to cred

wpcf-country-code

btw I found before an almost identical question(

from the view

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
	<label>[wpml-string context="wpv-views"]country[/wpml-string]</label>
	[wpv-control-postmeta field="wpcf-country" type="select" url_param="wpv-wpcf-country"]
</div>[wpv-filter-submit output="bootstrap"]
[/wpv-filter-controls]
[wpv-filter-end]

the form

[creduserform]
	[cred_field field="form_messages" class="alert alert-warning"]
	<div class="form-group">
		<label>Email</label>
		[cred_field field="user_email" class="form-control" output="bootstrap"]
	</div>
	<div class="form-group">
		<label>First name</label>
		[cred_field field="first_name" class="form-control" output="bootstrap"]
	</div>
	<div class="form-group">
		<label>Last name</label>
		[cred_field field="last_name" class="form-control" output="bootstrap"]
	</div>
	<div class="form-group">
		<label>Base Country</label>
		[cred_field field="user-base-country" force_type="field" class="form-control" output="bootstrap" urlparam='wpv-wpcf-country']
	</div>
	
	[cred_field field="form_submit" output="bootstrap" value="Submit" class="btn btn-primary btn-lg"]
[/creduserform]

thanks for your patience

#1193190

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bryan,

Thank you for contacting our support forum.

I would love to say that this is possible but it isn't

What is passed in the URL is the value of the selected item. So if the field value is FL but the display text is Finland then FL will be passed.

The wpcf-country field i'm assuming is a select field correct? If so then you can change the Value to the country code rather than the name and leave the Labels as the names.

Thanks,
Shane

#1193423

I didn't think of adding manual labels and values to the dropdown; it's not quite what I want, as its effectively just creating another list to sync. At least I understand the limitations at this point.