URL Pass Value Not Passing Everything

By: John Bosley | Asked: 09/07/2023
ForumsCategory: General questionsURL Pass Value Not Passing Everything
John Bosley asked 1 year ago

I have a form with a dropdown lookup field. When a user selects an option (Option 1), it populates a hidden lookup field (ID 306) with a url-friendly version of the same option (option-1). The reason I am doing this is so that I can type in a full name for the dropdown and a shortened name for the url.

 

The problem I'm running into is that the url redirect isn't passing all of the values. This is my redirect: https://url.com/game-view-[306]/?game=[306 sanitize_url=1]

 

The result I'm looking for should be https://url.com/game-view-option-1/?game=option-1

 

Instead, I'm just getting https://url.com/game-view-option-1/?game

 

This tells me it's pulling the correct info, for some reason it's just dropping it off of the end. 

 

It works fine when I try it and am logged in, but doesn't work in an anonymous browser window. I don't have any specific permissions set for the form. I have the default value for the hidden field [306] set to [get param="game"]. I have also tried not making it a hidden field, which didn't change anything.  Also, I keep trying to delete the sanatize_url=1 to see if that's what the problem is, but it keeps showing back up.

 

Any idea what's going on? Thanks!

2 Answers
Victor Font answered 1 year ago

From the Formidable KnowledgeBase: "The sanitize_url=1 shortcode is automatically added when inserting most field shortcodes into a Redirect URL". See the document for instructions about how to avoid automatic URL encoding. https://formidableforms.com/knowledgebase/advanced/#kb-sanitize-url

John Bosley replied 1 year ago

Thanks for the info. I tried setting it to sanatize_url=0 and that didn't change anything. I'm still running into the same issue. I just don't understand why the last part of the url is dropping off.

John Bosley answered 1 year ago
I was able to solve this issue. After digging around a bit more, I came across this article that mentioned caching could cause issues with auto-populated values: https://formidableforms.com/knowledgebase/using-dynamic-default-values-in-fields/#kb-troubleshooting   Figuring it couldn't hurt to try, I turned off all caching on my site (both in WP and on my host) and it now works fine for non logged in users. Hope this helps anyone else who may be experiencing something similar!
Victor Font replied 1 year ago

That's a good point. I turn off caching for all forms.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right