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.

Capture email from paragraph text input?

  1. rumblefish
    Member

    For various reasons I've had to construct a form using only paragraph text fields. Is there a way to capture the email input in paragraph text as a variable for replying to the user?

    Posted 13 years ago on Friday September 16, 2011 | Permalink
  2. You need to extract the email from a full paragraph of text, or the email address will be the only thing in the paragraph? And where do you want to be able to use this email address? As the address in the email notification to the user?

    Posted 13 years ago on Friday September 16, 2011 | Permalink
  3. rumblefish
    Member

    The email address is the only thing in the paragraph text field.

    I had to create the form using paragraph text fields because my theme is screwing with the design, making the paragraph areas and regular input areas look totally different.
    The form I created works, but when I go to set the admin notifications, I get this message:

    "Your form does not have any email field. Sending notifications to users require that the form has at least one email field."

    Obviously WP isn't seeing the paragraph text "email" field I created in the same way that it would see the advanced field version. So I wondered how to overcome this.

    One other small thing. How do I remove the "edit this form" link from under the submit button? I couldn't find it in the code for the gravity form.

    Posted 13 years ago on Friday September 16, 2011 | Permalink
  4. @rumblefish

    If this is just about a style problem, post a URL to your form page and I'll be happy to help you out. It's best to use a standard email field than to try to hack some other solution. That way everything, including notifications work as designed. The styling portion should be much much easier than trying to bend everything else around.

    Also, the "edit form" link is only visible when you're logged in as an administrator. The public doesn't see the link. You can hide it with CSS for now, but we've removed it completely from the upcoming 1.6 version so it will go away anyhow once we release that and you upgrade.

    Posted 13 years ago on Friday September 16, 2011 | Permalink
  5. rumblefish
    Member

    Hi Kevin,

    Ok, Tomorrow I should have the site up and I'll post you a link there. Thanks!

    Oh incidentally, even though I get the error message about the no email field, WP does send me a notification (as an admin) when I send a form. Does that mean it works okay - or perhaps I'm misunderstanding what's supposed to be happening?

    Posted 13 years ago on Saturday September 17, 2011 | Permalink
  6. The admin notifications will work without a having an email field in the form. The user notification requires an email address, for the user, to work.

    I would work with Kevin to get your styles straightened out, rather than try and work around the problem by using inappropriate form fields.

    Posted 13 years ago on Saturday September 17, 2011 | Permalink
  7. Okay, I'll be checking in periodically over the weekend so I'll look for a link and we'll go from there to get you fixed up.

    Posted 13 years ago on Saturday September 17, 2011 | Permalink
  8. rumblefish
    Member

    Hey Kevin!

    Ok I managed to get my (unfinished) site online. That in itself is a major miracle for me!

    This is a link to a demo of the theme I'm using as a base (shoutbox):

    http://www.kriesi.at/themedemo/?theme=shoutbox

    If you click "dropdown" and then "contact" you can see how Kriesi has set the style for the default contact form in the theme.

    Now this is the gravity form I put on my site:

    http://sos.cameratruck.es/?page_id=412

    I added two extra email fields right at the bottom so that you can see the difference in styles between the paragraph text fields and the regular input fields (white). For some reason the style.css of the theme is not changing the regular gravity input fields. Which makes the form look weird if it has two different field styles. That's why I did all the entries in paragraph text.

    I tried to find the css that was (or wasn't) affecting the regular input fields, but I can't find it.

    This is why I wanted to know how to extract the email from a paragraph text input.

    Hope you can help!
    Thanks again
    Richard

    Posted 13 years ago on Saturday September 17, 2011 | Permalink
  9. Hey Richard,

    This is going to be a lot easier than the way you were going although that was a valiant effort. LOL.

    The input styles in your theme stylesheet targeted inputs that were a child of the "commentform" div along with a generic rule for textareas. Since the Gravity Form doesn't live in the "commentform" div, it didn't inherit the input rules, but did the textarea rule. Thats why only the textarea element was styled like your theme. So.. blah blah blah, that's all well and good but how do we fix it?

    Easy peasy. Just add this new rule to the end of your custom.css file and you should be good to go. You can tweak it to suit your preference.

    [css]
    .gform_wrapper input[type="text"],
    .gform_wrapper input[type="url"],
    .gform_wrapper input[type="email"],
    .gform_wrapper input[type="tel"],
    .gform_wrapper input[type="number"],
    .gform_wrapper input[type="password"],
    .gform_wrapper select,
    .gform_wrapper textarea {
        background-color: #F8F8F8;
        border: 1px solid #EEE;
        padding-top:5px;
        padding-bottom:5px;
        font-size:1em
    }

    test screenshot: http://bit.ly/og3Wgo

    Once that's added, you'll probably want to go back and recreate your form using normal text input fields, etc. You'll get the benefit of more advanced field validation and some other things that aren't applicable to paragraph text fields in general. You'll probably want to go ahead an remove the custom height CSS rule you added for the textareas too. You shouldn't need that any longer.

    Hope that makes sense and helps out.

    Posted 13 years ago on Saturday September 17, 2011 | Permalink
  10. rumblefish
    Member

    That's awesome!
    I'll try it out and see what happens!

    :O)

    Thank you so much!
    This support forum is immense!

    Those terms in blue (Email, password etc) are those set by gravity? So depending on which of the input fields I use, I should use the appropriate gravity blue term in the css? Where do I find them, in the code for the form, once it's set up?

    One last thing, when making a really long form like mine is there a way to set where the new field enters? Right now they always go to the bottom and it's a pain to have to drag them up to the top again. Maybe in a future release you could make it so that the new field goes in directly under the last selected field on the constructed form.

    Posted 13 years ago on Saturday September 17, 2011 | Permalink
  11. If you have the HTML 5 option turned on in your settings, then yes, the email fields will be type=email, etc. If not, they're a standard type=text field. I added those into the rule so they would be there if you chose to use the HTML 5 option in the future.. you wouldn't have to add new rules for that.

    For now, new fields are added to the bottom of the list in the form editor. We're looking at changing that way that works in a future version.. possibly 1.7 but I'm not completely sure at this point. We'll probably implement a way to actually drag the fields from the toolbox to where you want them in the form structure, but we haven't completely worked out how we want to do that yet.

    Posted 13 years ago on Saturday September 17, 2011 | Permalink

This topic has been resolved and has been closed to new replies.