Skip Navigation

[Resolved] Default value set by query string not showing up in dropdown form fields

This support ticket is created 5 years, 7 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1248465
form-param2.png
form-param1.png

I am passing url parameters to a form as follows hidden link. The request-title shows up fine but the two drop-down fields do not show. The form code is shown in the form-param1 image attached. The frontend view is shown in form-param2. As you can see the default is not appearing and does not appear in the post when submitted. Am I doing something wrong?
Regards
Graham

#1248551

Hi, you need to use IDs in your URL params instead of post slugs or post names. The relationship form fields are set up to respond to IDs, so that's probably why the proper selections do not appear selected.

#1248683

When you say IDs do you mean the ID number of the user? I am currently passing the WordPress username which is identical to what shows in the dropdown when I click on it.

#1248707
form-param3.png

I have tried ID numbers, WordPress username. Neither work. When I activate the dropdown I get a list of the usernames that I am trying to preset - see image3

#1250197

When you say IDs do you mean the ID number of the user?
No, User IDs are irrelevant here because Users cannot be directly associated to posts by post relationship, and these two form fields establish post relationships. I am referring to the ID of the post that should be selected in the relationship field. In other words, the Request Owner and the Request Target Participant are custom posts in your site. You must pass the ID of the post that corresponds to the Request Owner or Request Target Participant which you want to be automatically selected. How that ID is associated to the User's ID or Username, I'm not sure offhand. It may be the case that your User is the author of those posts, or there may be some other association I don't fully understand.