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.

Custom Field Adding Form Name

  1. Hello,

    I have a form that is creating a new post and publishing it and everything is working fine except...

    I have a custom field that is a URL, when I go to the entries page in gravity forms the URL is entered correctly, but whenI go to the post that was created in the custom field the name of the form is appended to the beginning of the URL.

    For example:
    http://www.apple.com is submitted from a form named ABCForm
    Under entries I correctly see http://www.apple.com
    On the post page under custom fields I see ABCFormwww.apple.com

    I am new to using custom fields, so I am sure there is probably something I am doing incorrectly?

    Any help would be greatly appreciated.
    Lori

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  2. Hi Lori,

    How are you putting the URL into the custom field? And, how does it get displayed in your template? My guess is that you're putting it correctly into the proper custom field, with your form, but that your template, whatever uses the custom field, is messing it up some how. Please share how you're displaying the custom field and we can help you work it out.

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  3. Hi Chris,

    Thanks for the quick reply. If I correct the entry on the post page it displays the URL correctly. Let me show you a screenshot of how the edit post page shows the entry, so you can better see what I mean:

    Here is my entries page where the URL field is displayed correctly:
    http://cl.ly/2e0N1E3v3R2Z0h3C060o

    When I go to the edit post page for the above entry here is what the custom fields section looks like for the submitted post:
    http://cl.ly/0k2u0D3E3V3l1G3k2e0d

    If I correct the address the function I am using in my template to display the link works correctly, I just don't understand why it is adding the form name to the value.

    I am baffled since the form seems to be collecting the information correctly.
    Lori

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  4. Sounds like you're collecting the value just fine as evidenced by it being in the entry in the proper format.

    How does the value get into the custom field? Can you post a screenshot of that setting, however you're using it? Thanks.

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  5. Hi Chris,

    I am not sure I completely understand the question.

    I am using a gravity form to create a post with the custom field, most of the other fields are populated dynamically like the title, category and content and I have those fields hidden from the user by checking the admin only box under advanced settings for those fields. When I submit the form it creates a published post with all the correct data with the exception of this custom field which adds on the form name with no help from me as far as I can tell. The title of my form is 'Video Application' which is the text that is being added to the value.

    Here are the basic settings for the form field:
    http://cl.ly/1V0o2L3d423V2h210O1b

    And the advanced:
    http://cl.ly/063v0O3W0g43090g3u38

    Here is a larger screenshot of the edit post page that is being created by the gravity forms:
    http://cl.ly/2s1y2a311T1k0T0t052Y

    Form Title
    Video Application

    The hidden fields all working correctly:
    Post Title - Set to currently logged in user's name.
    Post Category - Set to predefined category
    Post Body - Set to publish the post with predefined text.

    URL Field as custom field, collects data correctly, but for some reason when populating the custom form field section of the published post it passes on the Form Name along with the value of the URL field as seen in my previous screenshot.

    Sorry if this is too much information or I misunderstood your question. I am not having any issues grabbing or displaying any of the data I am collecting, but for some reason the correct data isn't being passed to the post.

    Thanks,
    Lori

    Posted 12 years ago on Saturday October 22, 2011 | Permalink
  6. For now I added a line in my function to trim the "video application" text from the variable.

    I am an old classic asp web dev and am still learning to use php and customize wordpress with more advanced functions. It is entirely possible it is something I did that is causing the wrong value to be passed.

    I will continue to keep an eye out for what it could be but at least I found a temporary solution :)

    Lori

    Posted 12 years ago on Sunday October 23, 2011 | Permalink
  7. Glad you found a workaround. It's not normal for the form name to be inserted into your custom field like that, before the submitted value. Did you previously add anything to functions.php to modify this custom field or otherwise handle the form submission?

    Posted 12 years ago on Monday October 24, 2011 | Permalink