Support » Plugin: Contact Form 7 Dynamic Text Extension » Dynamic email address via custom field is lost when form loads via AJAX

  • Hey Chris!

    We exchanged brief notes on Twitter, but I was hoping you could take a quick look at this here.

    Your tutorial was awesome, and exactly what I needed. I run a site for people who organize ski leases, People submit their ski leases to me, and then I post them so people can contact the organizers. Your plugin was perfect because each ski lease should have its own contact form that goes to an email address unique to that page.

    I’m running into a problem though, because I’m loading the form into a lightbox that pops up via AJAX. Following your tutorial, I have email address stored in a custom field on each post, and when I embed the form on the page via editing my WP template, everything works great! Dynamic email is pulled, form works, email is sent. However, when I embed the form in the lightbox, for some reason, the email address isn’t pulled and the value attribute is empty:

    Any idea how to solve this? The alternative is just leaving the form visible on the page when you load it, but it would be so much cleaner to have it in a lightbox that can be triggered when people hit a ‘Contact’ button.
    – Evan

Viewing 1 replies (of 1 total)
  • Plugin Author sevenspark


    Hey Evan,

    My best guess is that the variable, which is available to the post when it is loaded, is not available to the lightbox, which is likely loaded via AJAX. You’d need to find a way to pass that variable again in order for the AJAX process to have the appropriate information. Alternatively, if your lightbox can handle inline content, just print the contact form on page load and hide it with CSS, then display it in the lightbox when Contact is clicked.

    Hope that helps 🙂


Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic email address via custom field is lost when form loads via AJAX’ is closed to new replies.