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.
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.
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.
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.
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...
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.
I would also like to see this feature in Gravity Forms. Is there an ETA on the development for it?
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.
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.