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.

Displaying data from a form

  1. hardseatsleeper
    Member

    Hello,

    I am brand new to this, as of an hour ago.

    What I'm trying to build is a user-generated directory of stores. So the form is wonderful for capturing all kinds of things - even with a Map It! button to display a captured address on a map - but as far as I can see, it will only natively display the items added under "Post Fields" in a post on the front end? All that data captured is mostly for backend use?

    So if someone fills out an address, this will only be available in the backend? Is this right?

    It seems like I would need to build a series of custom fields and then make a custom post page to display those bits of data (address, phone number, etc) and not use the out-of-the-box items at all. I would use the post custom fields instead.

    Does this sound right? Or is there an easier/better way to handle making this kind of form?

    Posted 14 years ago on Sunday April 25, 2010 | Permalink
  2. If you want to create posts based on the form data you would have to use Post Fields. These are the only fields that create Post data. The other fields are form fields for capturing user submissions for other uses (contact form, lead generation, etc.).

    You would need to use the Post Custom Fields to accomplish this combined with a custom post template to display this information the way you want it to appear.

    One of the field settings on the Post Custom Field is the type of field it is, so it can be more than just a simple text input box. However, it is a single selection field so some of the more advanced fields (such as Address) don't apply. So you would need to do multiple fields to accomplish an address input.

    Posted 14 years ago on Sunday April 25, 2010 | Permalink
  3. hardseatsleeper
    Member

    Thanks Carl, that's what I spent some time doing this afternoon.

    While it's a little more labour intensive than simply using the address field form, it's not all that much more work. And as you mention there are a lot of options for the input box - the entire country dropdown is available, for example.

    This thing has saved me a ton of work! I used the time I saved to eat chicken wings.

    Posted 14 years ago on Monday April 26, 2010 | Permalink
  4. You are probably past this stage now, but I'll include it here for anybody tryign to figure it out and coming across this post.

    The code I use for the custom fields is this (the custom field name below is date):

    <?php if( get_post_meta($post->ID, "eventdate", true) ): ?>
    <b>Date: </b><?php echo get_post_meta($post->ID, "eventdate", true); ?><br>
    <?php else: ?>
    <?php endif; ?>

    The only one this didn't seem to work with was when using a time filed. It then just says 'array' on it.

    There is probably a simpler way to do it, I'm no programmer and that was just trial and error and lots pf scouring through endless websites :)

    Posted 14 years ago on Monday April 26, 2010 | Permalink

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