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.

Table Structure Layout for Form (Rows & Columns)

  1. Hello

    Is it possible to format the form to resemble a table/excel spreadsheet? Each row would be one entry. The user would then be able to add a row if they ran out. When the form is submitted it submits the form as rows of entries.

    Please see below image to demonstrate what im talking about

    http://img109.imageshack.us/img109/3498/formmockup.jpg

    Posted 11 years ago on Thursday April 25, 2013 | Permalink
  2. Richard Vav
    Administrator

    Rather than several fields arranged into columns using CSS you would use a List field for this with multiple columns enabled, when displayed on the front end the visitor would be able to add or remove rows as required.

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

    Regards,
    Richard

    Posted 11 years ago on Thursday April 25, 2013 | Permalink
  3. Richard Vav
    Administrator

    @david @rob maybe you could add an example showing the list field functionality to the demo site during the upcoming documentation updates for 1.7

    Posted 11 years ago on Thursday April 25, 2013 | Permalink
  4. Awesomeness! Next question... Is it possible to set one of the columns to be a dropdown with specific values?

    Posted 11 years ago on Thursday April 25, 2013 | Permalink
  5. Richard Vav
    Administrator

    It sure is, the following example targets the first column of field 2 on form 6, you would place this in your functions.php file between the opening <?php and closing ?> tags

    add_filter("gform_column_input_6_2_1", "set_column", 10, 5);
    function set_column($input_info, $field, $column, $value, $form_id){
        return array("type" => "select", "choices" => "First Choice,Second Choice");
    }

    Or if you want to specify values for each choice you would use this

    add_filter("gform_column_input_6_2_1", "set_column", 10, 5);
    function set_column($input_info, $field, $column, $value, $form_id){
        return array("type" => "select", "choices" => array(
                array("text"=>"First Choice", "value"=>"First"),
                array("text"=>"Second Choice", "value"=>"Second")
               ));
    }

    Here's the relavant page in the documentation http://www.gravityhelp.com/documentation/page/Gform_column_input

    Posted 11 years ago on Friday April 26, 2013 | Permalink