1

I've this form:

f[a_, b_] := a + b;
form = FormFunction[FormObject[<|"a" -> "Number", "b" -> "Number"|>], f[#a, #b] &];
form[]

How I can automatically bring up the form after the output display? (If I insert 3 and 2 and I click submit, it return 5. After 5, I'd like to see the form again.) And can I remove "Cancel" or assign it an action like "Submit" button? Thanks

RossFe
  • 15
  • 3

2 Answers2

1

The form[] can be returned as the output.

f[a_, b_] := a + b;

form = FormFunction[
   FormObject[<|"a" -> "Number", "b" -> "Number"|>], (Print@f[#a, #b]; form[]) &];

form[]

enter image description here

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
0

I solved with

f[a_, b_] := a + b;
FormPage[{"a" -> "Number", "b" -> "Number"}, f[#a, #b] &]

The result is show below the form.

RossFe
  • 15
  • 3
  • I've an other problem with this type of form but with an other example. I've a function f with different Print. The output is show below the form but Print's output are shown in an other window (a notebook called "Message"). How can I disable this notebook to show its contents directly below the result of the function? – RossFe Jun 26 '16 at 13:06