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.

enum values

  1. May I use enum values from a custom table in forms made with Gravity Forms?

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink
  2. David Peralty

    Can you explain more about what you are trying to do, please?

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink
  3. I'm locking for a plugin that can handle my custom table with enum-fields in. I would like to have a form that builds a drop-down list from the enum values that already excist in the table.

    Like this php:

    $result = mysql_query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = '$table_name' AND COLUMN_NAME = '$column_name'")
    or die (mysql_error());
    $row = mysql_fetch_array($result);
    $enumList = explode(",", str_replace("'", "", substr($row['COLUMN_TYPE'], 5, (strlen($row['COLUMN_TYPE'])-6))));
    foreach($enumList as $value)
    echo "[option value=$value]$value[/option]";
    echo "[/select]";

    All the best,

    Mikael

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink
  4. If you would like to dynamically populate a drop down field on your form using values from a custom database or custom tables, you can do so by dynamically populating the field using available hooks and custom PHP.

    This would only allow you to populate the drop down options, the form is still going to store it's data in the Gravity Forms entry tables unless you customize it further to behave otherwise.

    Here is information on how to dynamically populate a drop down using PHP:

    http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink

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