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.

List Field (minimum number of lines?)

  1. Is there a way to set up the new List Field type with a minimum (and maximum) number of fields? Basically I want to set it up that users have to enter 5 fields (no more, no less...) ie. Name your top 5 favorite websites:... etc.

    Posted 12 years ago on Thursday November 17, 2011 | Permalink
  2. Currently the List Field only supports a max line number. It does not currently support a minimum number of lines. It is a feature we can look at including as an enhancement to this field in the future. The List Field is brand new so it will continue to evolve.

    Posted 12 years ago on Thursday November 17, 2011 | Permalink
  3. If you're asking for 5 pieces of information, why not use five regular form inputs? You do not need to adjust the number of rows dynamically, since you're never allowing anything but five.

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  4. Well, we liked the way the list output was set up in columns and that there was one label for all of them (with a column heading) (rather than one label per..). I was initially thinking that I could just call the function the (+) sign does on page load 4 additional times to pre-load the fields - it appears the function is gformAddListItem() but I'm not sure what parameters to pass it in order to get it to work correctly...

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  5. You can accomplish the same look by hiding the field labels with CSS, and using some gf_inline styles to layout the inputs in columns. I think it will be easier than trying to force the list field to always show 5 input rows. If you put a form online with 5 rows as you want them, post the URL and we will help you with the layout.

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  6. I would also like to see this feature in Gravity Forms. Is there an ETA on the development for it?

    Posted 12 years ago on Saturday December 31, 2011 | Permalink
  7. I had this problem and I did the following:

    Our min was 3. Our max was 9. So I put 2 regular line texts followed by a list field with a max of 7 and required them all.

    If you need the "split" Just add a list field with a max of 1 and mark required.

    Have to do a little more code mojo but it's a decent hack until minimum is added.

    Posted 11 years ago on Friday November 30, 2012 | Permalink
  8. Developer David Smith posted this recently as well:
    http://gravitywiz.com/2012/06/03/set-number-of-list-field-rows-by-field-value/

    That will enable you to set the number of rows, but it's a fixed number, not a minimum or maximum.

    Posted 11 years ago on Saturday December 1, 2012 | Permalink