Jump to content

FormBuilder repeating fields?


BitPoet
 Share

Recommended Posts

I'm considering purchasing FormBuilder for out corporate intranet to re-implement a decent number of forms. I've got a solid (albeit optically a bit outdated) form template solution that I built 12 years ago (I love seeing that number) and integrated into PW at some point. Since I'm up to my neck in work (and going to be that for quite some time), FB could be a means to quickly offload some work to colleagues since the old solution has text based templates and thus a bit of learning curve. A lot of our forms will need repeating rows, though.

Thus, the question: does FB support repeaters (text/number fields would be enough), or some other type of repeatable field groups?

  • Like 1
Link to comment
Share on other sites

I don't know of any repeatable fieldtype in FormBuilder;

but since i needed it, i just used javascript to make the repeatable fields on the form, and then i concatenate the values into 1 hidden field on submit.  On this field the date and the event artists are repeatable.

https://www.elliottcarter.com/submit-a-performance/

so you wouldn't really be able to do it out of the box, but you could have the editors create all of the forms, and then go through them and add the repeatable stuff using the FB js file.

  • Like 1
Link to comment
Share on other sites

12 minutes ago, Macrura said:

so you wouldn't really be able to do it out of the box, but you could have the editors create all of the forms, and then go through them and add the repeatable stuff using the FB js file.

I remember you mentioning this in the FB subforum and it's a nifty solution. In terms of letting editors add the repeatable field, you could bundle the bits into a custom inputfield module and then include it in the types allowed for FormBuilder.

  • Like 1
Link to comment
Share on other sites

Thanks for the feedback. I feared that the repeatable stuff has to be hand wired. I'm counting on being able to use the save to page feature, so I'd have to add pushing these fields' values into repeaters myself, and probably also add an indicator to make field groups as repeatable in the form editor and enhance the field mapper to include repeaters... I have to meditate on that ;)

Link to comment
Share on other sites

Hello BitPoet and others,

don't know if this can help, but before few days in one project I need some solution to store repeatable urls, and build fieldtype "Repeats". It is very simple repeatable input (varchar/text) field (one of custom fields created thanks to Ryan Events module). I am sure that for you wouldn't be a problem to copy/paste/rename and create integer/float repeatable field.

I had build many PW fields types but never had enough time to polish it and place in PW modules section.

Regards.

FieldtypeRepeats.zip

EDIT:

I read this topic again, and because these days I am mostly in "backend forms job", my first thought was that you need this for backend forms. Sorry for that. Please note - this field type is not for front-end forms  - it is for backend/admin forms. Also, here is example how to get field values at front-end.

// my first plan was to store few "link" details
// because of that, need to call "value"

// default
foreach($page->field_name as $url){
    echo $url->value;// note: "value"
}

// to get first row
echo $page->field_name->first->value;

 

  • Like 1
Link to comment
Share on other sites

@OLSA: Thank you for sharing this. I have a built a few array field types before and also thought about using an approach like the Events field type, but the problem with that is that I'd have to create a distinct type for every group of fields and change the module's source code whenever the format of its "row" changes.

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...