Show list in rows instead of columns

Attempting to create a form with a “table”, and I have done so in the past using List to have multiple columns with success. My challenge this time is that I need to do it in reverse. Under the General Options it lists Columns - Enable Multiple Columns. Is it possible to to Enable Multiple Rows?

In essence I want to the the following visually:

Row 1 Title Row 1 Entry
Row 2 Title Row 2 Entry
Row 3 Title Row 2 Entry

As opposed to the default of:

Column 1 Title Column 2 Title Column 3 Title
Column 1 Entry Column 2 Entry Column 3 Entry

This should get you pretty well there.

Set Row Headers & Receive Tabular Data in Gravity Form List

1 Like

I completely forgot you had posted that! :pray:

1 Like

Thank you, appreciate the link!

Following through with the steps my results are as follows - it is alternating every other array left to right, not down the first column.

add_filter( 'gform_field_value_sce-rrs-data-element', 'typewheel_prefill_certifications_list' );
function typewheel_prefill_certifications_list( $value ) {
    $list_array = array(
        array(
            "RRS Data Element" => "Record Class Name",
        ),
	  array(
            "RRS Data Element" => "Record Class Description",
        ),
	  array(
            "RRS Data Element" => "Cross Reference",
        ),
	  array(
            "RRS Data Element" => "Retention Period",
        ),
	  array(
            "RRS Data Element" => "Retention Event",
        ),
	  array(
            "RRS Data Element" => "Document\Record Types, Add",
        ),
	  array(
            "RRS Data Element" => "Document\Record Types, Delete",
        ),
	  array(
            "RRS Data Element" => "Legal Citations",
        ),
	  array(
            "RRS Data Element" => "Other",
        ),
	    
    );
    return $list_array;
}

------

<script>
  jQuery(document).ready(function(){
      jQuery( '.gfield_list_28_cell1' ).find( 'input, select, textarea' ).each(
      function() {
         if ( jQuery( this ).val() != '' ) {
          jQuery( this ).prop( 'readonly', true );
          jQuery( this ).css({'background':'none','border':'none','box-shadow':'none'});
          jQuery( this ).attr('tabindex','-1');
          jQuery( this ).parents('tr:not(:last-child)').find('.gfield_list_icons').hide();
        }
      });
  });
</script>

Interesting. I feel like I had encountered something similar to that before, but I can’t recall at the moment what has caused it. :thinking: I feel like in my case it may have resolved itself after I’d played with the form some.

Wondering if it is my theme. Still digging through to see what the issue is yet. Beyond that it works perfect, thank you again for the help.

1 Like

Well I am stuck. Might have to ditch this idea, and go to a more traditional list. Not finding anything (granted I am no expert by any means) that sticks out that would be causing my issue.

If you want to DM me an export of the form, I’d be happy to take a quick peek with the code you have above.

2 Likes

Sadly my “Trust Level” is not up to par to be able to send PM’s yet.

Ah, hate when that happens. I’ve never been able to upvote on StackOverflow for this very reason. Feel free to connect with me via this contact form and we can correspond via email, if you like.

It appears that the issue is related to the fact that your field has conditional logic enabled. When I remove the conditional logic, it seems to render properly. Could you confirm that the same would fix it on your end?

It would seem this is probably a bug or limitation of the gform_field_value_$parameter filter being used alongside conditional logic within Gravity Forms. Maybe another dev might have insights as to why conditional logic would be conflicting with this code filter?

Never even thought of that. I just changed from Hide to Show in the conditional logic and it works. I will rework how I am presenting the field and report back. Thank you for the help!

This is very strange.

I can only get it to work using Show if the default value of either of the drop downs two to this list is selected. Whether that be the actual default value, or a placeholder.

@uamv Thank you again for the help. I am getting around this at the moment with pages. Instead of having conditional logic for this list to show, the next page is dedicated to a drop down and this list.

Going to keep playing with this to see if I can figure it out regardless. I like puzzles, and a challenge.

Nice. Yeah, I think there’s probably got to be something funny going on in GF core when handling values. Hope you land on a workable solution. Woohoo puzzles!

© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.