Cloud & Web Interfaces

Create a Dynamic Webpage

FormPage works in many ways like FormFunction, but it keeps the form above the result, so that you can keep interacting with it.

In[1]:=
Click for copyable input
CloudDeploy[ FormPage[{"n", "Please enter the number of sides"} -> Restricted["Integer", {3, Infinity}], Graphics[RegularPolygon[#n]] &]]
Out[1]=

You can visit the page to interact with it: at first no result is shown.

Entering a number will update the page.

You can improve the FormPage by changing the default controller and the placement of the elements. AutoSubmitting is also useful if you want the page to update whenever a field is changed.

In[2]:=
Click for copyable input
CloudDeploy[ FormPage[{"n", "Please enter the number of sides"} -> AutoSubmitting[<|"Interpreter" -> Restricted["Integer", {3, 20}], "Control" -> Slider|>], Graphics[RegularPolygon[#n]] &, {"Form"} -> {"Form", "Result", "Form"}]]
Out[2]=

Visit the resulting page.

Related Examples

de es fr ja ko pt-br ru zh