• Resolved jlabonney

    (@jlabonney)


    I need to put the same form in numerous posts. Is there any way to capture the post title of the post where the form is being filled out in the form data?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author hoffcamp

    (@hoffcamp)

    You could make a ‘hidden’ field, using conditions, and then some javascript to scrape the current post’s title and put it into the hidden field.

    Hi guys.

    I’m trying to figure out how to make the same thing with the hidden field but no luck yet. Is there any way you could provide a sample code for this?

    Also, for not creating a new topic here, I’m having a “Submission” word in email title, is there any way I can remove it? I’ve created a template for email and don’t want to override it and all settings for the form just to remove the word from the subject.

    Thanks in advance, your plugin is GREAT!

    Plugin Author hoffcamp

    (@hoffcamp)

    I’m putting an option to change the e-mail title and subject without using the fully customized e-mails in the next update.

    For grabbing the post title, follow these steps:

    1. Make a text field in your form
    2. Go to the ‘form extra’ and give it a nickname, something like ‘post-title’
    3. Make a note field in your form, remove the label, and click the ‘HTML’ checkbox below the note.
    4. Put the following in the note:

    <script type="text/javascript">
    jQuery(document).ready(function(){
    var txt = fm_get_form_item('post-title');
    txt.value = document.title;
    });
    </script>

    If that doesn’t work, (since there might be no jQuery) try this:

    <script type="text/javascript">
    window.onload = function(){
    var txt = fm_get_form_item('post-title');
    txt.value = document.title;
    }
    </script>

    Now you will see a text field that has the current page title as the default value.

    5. Go to ‘conditions’, and make a new condition. For the three dropdown boxes, select ‘Only show elements’, ‘Never’, and then ‘post-title’.

    If you are handy with JavaScript you can try to grab the actual post title rather than the browser title, but since that is theme dependent, there isn’t a surefire way to grab it.

    Thank you, thank you! This works like a charm!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: WordPress Form Manager] post title’ is closed to new replies.