WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Contact form subject (12 posts)

  1. Corinne
    Member
    Posted 2 years ago #

    Hi, I love the new contact form addon, but was wondering if you could add something like a 'subject' field which would then become contact form subject?

    I see the new addon is based on Grunion Contact Forms, which had an option in its shortcode to show the subject so the person filling it in could change it. I tried adding this to the shortcode but it didn't change anything.

    It would be useful for me to see what each email is about in the subject before I open it up, so I would love for this feature to be added.

    http://wordpress.org/extend/plugins/jetpack/

  2. Chad Warner
    Member
    Posted 2 years ago #

    I agree that this would be a nice addition. I'm used to it as the default behavior in Contact Form 7.

  3. martijnonline
    Member
    Posted 1 year ago #

    +1 for this!

  4. Tim Moore
    Moderator
    Plugin Author

    Posted 1 year ago #

    You can; when you create the contact form, there is a second tab at the top of the window. In that second tab you can set the subject and an optional To: address.

  5. Chad Warner
    Member
    Posted 1 year ago #

    Tim, I see that option, but that just sets a static subject for all emails. What I'm looking for is a way to create a subject field, visible on the front-end, where a visitor can type the subject of their message. What they enter in that subject field would be used as the subject line in the resulting email.

  6. Tim Moore
    Moderator
    Plugin Author

    Posted 1 year ago #

    Create a new field in your form, in the form builder, and same it as a text field. After you insert the form into your page, look at the code and change the "type" of the field from text to subject.

    It should look like:

    [contact-field label="Subject" type="subject" required="true" /]

  7. Chad Warner
    Member
    Posted 1 year ago #

    That worked! Thank you very much, Tim!

  8. nishantphotography
    Member
    Posted 1 year ago #

    Tim, that is a wonderful solution to most of our problems.
    This works if "Subject" is a text field, and if user is typing in a custom subject name. Would it be possible to get the Subject name in a method where the user selects a list of subject names from a Drop-down menu rather than typing a subject name?

  9. Ronak Gandhi
    Member
    Posted 1 year ago #

    This trick really worked, thanks.

    But one problem is that the Subject field is pre-filled with the page/post title. Is it possible to have it blank?

  10. Chad Warner
    Member
    Posted 1 year ago #

    Yes, add default='' like so: [contact-field label="Subject" type="subject" default='']

    I blogged about this: Add a subject field to a Jetpack contact form.

  11. AWN
    Member
    Posted 1 year ago #

    Thank you all and it was great.

    One more thing, the values of my name and email are prefilled how to prevent this? I think it remembers from browser.

    This is my website

    Appreciation in advance.

  12. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Your name and email are indeed prefilled as long as you are logged in.

    if you visit your site from another browser, or in an incognito window, your name won't be displayed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags