Is there a way to make InputField[] compatible with RepeatingElement or a similar scheme of user interaction? The idea is to create an interface with many user defined variables, as many as the user sees fit to be exact.

  • $\begingroup$ Why not just several InputFields? After all, how will you plan to segment (separate) individual variables during entry? $\endgroup$ Feb 15, 2018 at 23:41
  • $\begingroup$ @DavidG.Stork The question then would be how to enable the user to make the several InputField's appear and disappear from the GUI panel with the click of a button. $\endgroup$
    – useranonis
    Feb 15, 2018 at 23:52
  • $\begingroup$ Being able to add new input fields or buttons or any other elements is something that you can probably find among the Q&A here. You need a button to add the element, a button to remove it -- if you want that capability, and use of function such as Table and With. I think the advanced dynamics tutorial in the docs has examples as well. $\endgroup$ Feb 15, 2018 at 23:58

1 Answer 1


Here's something to start with:

multiInput // ClearAll
multiInput[Dynamic[list_], type_: Number, def_: 0, opts___] := 
 DynamicModule[{n = Length[list]},
    Button["+", AppendTo[list, def]; n++;],
          InputField[Dynamic[list[[#]]], type, opts],
          Button["-", n--; list = Delete[list, #]]
          } &@i, {i, n}]
      , Alignment -> {Left, Center}],
     TrackedSymbols :> {n}

    }, BaseStyle -> 
    ButtonBoxOptions -> {ImageSize -> All, FrameMargins -> 5, 
      ContentPadding -> False}]

l = {};

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.