Jump to:

23453 Posts in 18902 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Number of form field rows dynamically displayed based on number from dropdown field

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1256 Views
  • Spiggley
    Avatar
    Community Member
    12 Posts

    Number of form field rows dynamically displayed based on number from dropdown field Link to this post

    I've been trying to work out how to create a dynamic booking form within silverstripe that will allow the user to choose the number of candidates to be booked on a course from a dropdown, then display that number of sets of fields for the entry of each candidate's details. I have the silverstripe book and can understand more straightforward forms. Is this kind of functionality possible using forms within silverstripe?

    Any help would be gratefully recieved.

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Number of form field rows dynamically displayed based on number from dropdown field Link to this post

    Hi,

    I'd say that this is going to be easier if the two things are not on the same page, then in site because you could have one page with one form (maybe use http://www.silverstripe.org/multi-form-module/) that collects the number of people and then the next form when you create the FieldSet you can loop the number of required times to create that number of fields. Also place the number of people into a Hiddenfield so this can then be used to save the form data correctly.

    Otherwise AJAX will help you do the same on the same page.

    Barry

    1256 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.