Wolfram Language

Cloud & Web Interfaces

Add an Arbitrary Number of Fields to a Form

Sometimes there is no way of knowing how many fields will be necessary for a form in FormFunction. RepeatingElement allows you to create a super-field that can contain several lines.

Click for copyable input
CloudDeploy[ FormFunction[ "addresses" -> RepeatingElement["StreetAddress", {2, 5}], GeoGraphics[ Append[GeoMarker /@ #addresses, Style[Line[TravelDirections[#addresses]], Thick, Red]]] &, AppearanceRules -> <| "Title" -> "Get travel directions for your trip"|>]]

The form starts out with two fields; you can click the plus sign to get more.

Submit the form to see the map of your trip.

Related Examples

de es fr ja ko pt-br ru zh