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.

Post Title (concatenate files)

  1. cipek1981
    Member

    I have two fields (single line text) on form, and two image fields. On post this form, in table wp_post, column POST_TITLE have value (Untitled_X) - X is number.

    After I put Post field (Title) i got in table wp_post, column POST_TITLE value from Title fields. But, I want to on submit concatenate two single line text fields in one. (Post title = single_line_text_1 || single_line_text_2).

    I try on advanced tab of (Post field) in Default value (insert variable) add somthing like this:
    $_POST['name_of_single_line_text1']
    $_POST['name_of_single_line_text2']
    {user:input_1}
    {user:input_2}....

    but nothing . Is it possible in this way? If not, what to do?

    Sorry on my english

    Posted 13 years ago on Monday July 25, 2011 | Permalink
  2. I created a quick form here:
    http://gravity.chrishajer.com/title-test/

    I added two fields, First half of the title and Second half of the title. These are NOT Post type fields, just normal single line text inputs.

    Then I added a Post Title field, and marked it admin only. That will prevent it from showing up on the front end where people would be required to enter a value. Be sure that you DO NOT mark this as required, as the form validation will fail (the user can't see it because it's admin only, but you marked it required, which they cannot abide by.)

    For that field, check "Create content template". That will enable you to concatenate two single lines of text into one line, the title. After you click that check box, you will be presented with a drop down that says "insert form field" by default, and in the drop down are the other fields on the form, plus some other information which is captured by Gravity Forms.

    Here's what my Content template for the Title looks like:

    {First half of the title:1} || {Second half of the title:2}

    That takes my first field, adds the " || " in the middle, then adds the second field and uses that as the post title. You can see an example submission here:
    http://gravity.chrishajer.com/2011/07/25/dogs-are-cool-except-when-theyre-not/

    You might want to limit the number of characters in your two single line text inputs as the two lines when added together might get very long.

    If you need more help, please let me know. Feel free to submit the form if you want to see how it works.

    Posted 13 years ago on Monday July 25, 2011 | Permalink
  3. cipek1981
    Member

    Tnx.

    Some things are so simple :) I went to the wrong direction. I saw the field Default Value, and I try with this...

    Posted 13 years ago on Monday July 25, 2011 | Permalink
  4. Please post back when you have it resolved or if you need additional help.

    Posted 13 years ago on Monday July 25, 2011 | Permalink