WordPress.org

Ready to get started?Download WordPress

Forums

Visual Form Builder
[resolved] Change a textfield's default value when embedding form into page (4 posts)

  1. jamesbickerton
    Member
    Posted 1 year ago #

    Hello
    First of all great plugin, I am a pro user and love it.

    For the first time I want to embed the same form over 20 pages but want to change either the email subject or a textfield's default value to a new one I have specified when embedding the form into the wordpress page.

    I thought I might be able to do it using the "merge tag" variable by doing something like
    [vfb id=1; vfb-15="New default value for textfield here";]

    Is something like this possible or would I have to create 20 forms with either a new email subject or new textfield default value in each form?

    The reason why I want this?

    It is a booking form and each page is a different property to book so it needs its own name on either the form or email subject field so the client can understand which property the customer wants to book.

    Thanks

    J

    http://wordpress.org/extend/plugins/visual-form-builder/

  2. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    I'd recommend using hooks for this.

    Here's the VFB hooks available to you.

  3. jamesbickerton
    Member
    Posted 1 year ago #

    Thanks Matt
    I'm a PHP newbie so none of those hooks jump off the page at me and scream "Hello, I'm the one, use me!"

    Is there a tutorial I could follow to implement this?

    Thanks

    J

  4. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    This is the exact hook you want, vfb_email_form_settings.

    In pseudo-code, this is what you want to do:

    1. Get the Post/Page slug or ID
    2. Based on that, set the email subject to what you need it to be

    That should get you started.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic