PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Different default value of a field depending on the referrer?

  1. adrien
    Member

    Hi,

    Here is a "simple" thing I want my form to do. I want the default value of the 5th visible field of the form accessible below (which is a drop down) to be different depending on the page the person came from.
    http://b-unique.ca/adwords/contact/

    Any idea on how to do this?

    Thanks,

    - Adrien O'Leary

    Posted 14 years ago on Tuesday January 12, 2010 | Permalink
  2. I will have to test and see if this is possible. It is possible to set the default value of a field using PHP, but I need to look into how to set the default value of a DROP DOWN and if it is possible with the existing API hooks. I'll keep you posted. It might be tomorrow before I can get back with you on this.

    Posted 14 years ago on Tuesday January 12, 2010 | Permalink
  3. adrien
    Member

    Thanks Carl. I thought that would be possible to add a PHP parameter on the URL where the form is. The default value of the drop down would be taken depending on the value of the parameter. How does this sound?

    Posted 14 years ago on Wednesday January 13, 2010 | Permalink
  4. Adrien,
    You can set the the selected value of a drop down based on a query string parameter. Try the following:
    1- In the form editor, select your drop down field, go to the advanced tab and check the "Allow field to be populated dynamically" field. Enter a parameter name for it (i.e. mydropdown)
    2- When linking to the page/post that has the form, create your url passing the value you want selected in the quey string. For example, if you have an item in your drop down called "Cars", you would use the following url: http://your_url.com/my-page/?mydropdown=Cars

    Posted 14 years ago on Wednesday January 13, 2010 | Permalink
  5. adrien
    Member

    Hi Alex,

    It works like a charm. Thank you very much.

    Best Greetings from Montreal!

    Posted 14 years ago on Saturday January 16, 2010 | Permalink