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.

pass current page title as hidden field in ajax thickbox form

  1. Hey ya'll,

    I have a form that I'm loading in a Thickbox form with AJAX. I want to pass the post title into the form as a hidden field.

    Here's what I'm doing, which isn't working.

    I'm setting the parameter name to: property.
    Allowing the field to be populated dynamically.
    Inserting this into my template:

    <a class="thickbox" href="/forms/schedule-a-showing?height=500&width=420&property=<?php echo basename(get_permalink()); ?>">Link text</a>

    Anyone have an idea?

    Thanks,
    Jacob

    Posted 10 years ago on Tuesday September 6, 2011 | Permalink
  2. Do you have a page where this is in practice so we can take a look?

    Posted 10 years ago on Wednesday September 7, 2011 | Permalink
  3. Thanks Chris,

    Here you go: http://manhattanmiami.com/property/250-west-street/

    There are a few hundred properties on the site. The 4 black blocks in the left sidebar are the form popup links. Each will act more of less the same.

    Thanks,
    Jacob

    Posted 10 years ago on Wednesday September 7, 2011 | Permalink
  4. The link for the lower right hand block is missing the leading /, so the link looks like this:

    [html]
    href="forms/request-availability?height=500&width=420&property=250-west-street"

    instead of this (like all the others):

    [html]
    href="/forms/request-availability?height=500&width=420&property=250-west-street"

    That was throwing me off for a while since I just happened to be testing that one link (form.)

    However, when I try to load any link in the address bar (not the thickbox) the query string is stripped off and a status code 301 Moved Permanently is returned.

    I tried to load this address:
    http://manhattanmiami.com/forms/schedule-a-showing?height=500&width=420&property=250-west-street

    Server returned a 301 code and directed me to this address:
    http://manhattanmiami.com/forms/schedule-a-showing/

    One thing that tells me is that in building your links you need to have a trailing slash after the page name (permalink) like this (after the word showing):

    [html]
    href="/forms/schedule-a-showing/?height=500&width=420&property=250-west-street"

    HOWEVER, that still does not fix the problem. When I try to load that URL, I just get the "schedule-a-showing" page.

    This is not an issue with Gravity Forms. It's something with your server, either stripping out the query string parameters due to some rewriting or something with the CDN, I'm not sure. Once you resolve that and can load one of those URLs in the address bar, I think the "property" parameter will work.

    Posted 10 years ago on Thursday September 8, 2011 | Permalink