• Resolved benspr

    (@benspr)


    Hi,

    I’ve created a 4-column fieldset with a DropdownDS field that populates 2 LinetextDS fields, which are then multiplied in a calculated field.

    I’d like to allow my users to add additional rows in this space as they need, by clicking a button like “Add row”. Is this possible to do, and would I be able to sum all the calculated fields at the end?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter benspr

    (@benspr)

    Or maybe just something to show more rows which have already been created, but which don’t show until the user clicks the button…

    Plugin Author codepeople

    (@codepeople)

    Hello @benspr,

    Unfortunately with the current version of the plugin it is not possible generate new fields at runtime, however, you can insert all rows, hidden by default, and display them at runtime, the equation would be simply the sum of the fields in all the rows.

    I’ll try to describe the process with an example:

    1. Insert a “DIV” field for each row with the corresponding fields, and then enter through the attribute: “Add CSS Layout Keywords” of these “DIV” fields the text: my-row hide

    2. Insert a button field to display the rows at runtime, and enter the following piece of code as its onclick event:

    jQuery('.my-row.hide:eq(0)').removeClass('hide');

    and that’s all.
    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Allowing the user to dynamically add form fields’ is closed to new replies.