function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
New_DeveloperNew_Developer 

How to capture a hidden field on the webpage which is redirected to the force.com site

Hi,

What iam trying to acheive here is the affiliated tracking. we have different affiliates and there is button on each of their websites which will redirect to a force.com site visualforce page of our company. They all have a input hidden filed which stores the affiliate code. I need to be able to capture that code when its redirected to the force.com site and store it on a field in salesforce. What is the best way to acheive it. Any help is greatly appreciated.

Thanks
KevinPKevinP
I'm going to make the assumption that your page is appending the affiliate code via a url param like ?foo=bar123 OR by posting it. Either way you can grab the value in your apex controller or controller extension via:
String MyParameter = ApexPages.currentPage().getParameters().get('foo');

 
New_DeveloperNew_Developer
Thanks Kevin. But can we use the same method if the parameters from the webpage are passed through POST method and not the GET Method??
brit leebrit lee
Thank you Kevin. I have used your codes on patronsurveys com (https://patronsurveys.com/) which is the official sweepstakes site.