Skip Navigation

[Resolved] Cannot Set Field for Parent with value from Urlparam

This thread is resolved. Here is a description of the problem and solution.

Problem:
The issue here is that the user was trying to get a value from the URL parameter but it wasn't working.

Solution:

In this user's case they did not set the correct url parameter attribute in their form field.

For this user they had urlparam="the-profile-id" as the form attribute url parameter but they are passing "the-hr-profile-id" in the url.

So the correct item should be urlparam="the-hr-profile-id". In a form field it would look like.
[cred_field field="@hr-profiles_wtn-document.parent" value="" urlparam="the-hr-profile-id" class="form-control" output="bootstrap" select_text="--- not set ---"]

This support ticket is created 5 years, 10 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 4 replies, has 2 voices.

Last updated by KentS9937 5 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1180155

I'm passing an urlparam with the value of a post ID to a form. I want the form to use that ID to set the parent relationship.
I have verified the urlparam is being attached to the URL.

	<div class="form-group wtn-hidden">
		<label>hr-profiles_wtn-document</label>
		[cred_field field="@hr-profiles_wtn-document.parent" value="" urlparam="the-profile-id" class="form-control" output="bootstrap" select_text="--- not set ---"]
	</div>

This doesn't work. It leaves the hr-profiles_wtn-document.parent value empty.
I expected it to set the value to the urlparam "the-profile-id"

#1180215

Shane
Supporter

Languages: English (English )

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

Hi Kent,

Try adding this as your value attribute.

[wpv-search-term param='the-profile-id']

This should get the value from the url.

Thanks,
Shane

#1180264

Hmmm. It's still not working. I'll share more information in case this helps you spot the cause of my problem. I'm wondering if my URL Parameters are not being attached correctly.

My view for cg-hiring-checklist has this code to call the Form.

[wpv-no-items-found]
		<a href="#" data-toggle="tooltip" data-placement="top" title="[wpv-taxonomy-description]">[wpv-attribute name="doc-tax"]</a> -<strong> No Documents Found.</strong> 
<a href="<em><u>hidden link</u></em> item='@hr-profiles_cg-hiring-checklist.parent']">Add one Now</a>
[/wpv-no-items-found]

Here's an example of the URL which is generated from the code above.
hidden link

It looks to me like the parameters were added to the URL correctly.

In the form which is trying to grab those url paramaters I ran a simple test to see if it's finding the url parameters. I inserted the following code.

<p>the-profile-id = [wpv-search-term param='the-profile-id']</p>
<p>wpv-relationship-filter = [wpv-search-term param='wpv-relationship-filter']</p>

The resulting output is not displaying either url param. I'm not sure why.

#1180272

Shane
Supporter

Languages: English (English )

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

Hi Kent,

You seem to be using the wrong value.

From your example you have urlparam="the-profile-id" as the profile url parameter but you are passing "the-hr-profile-id" in the url.

So you should change the-profile-id to the-hr-profile-id

Please let me know if this helps.
Thanks,
Shane

#1180306

Ugh. Head slap! Thanks for helping me solve my problem. My issue is resolved now. Thank you!