[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 6 years 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.
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"
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.