Working with FormFunction

  1. Should I expect multipage FormFunction to work on cloud?

     CloudDeploy @ FormFunction[{
        {{"rooms" , "number of rooms"} -> "Integer"}, 
        Function[Table[{"room" <> ToString[i],  "guests in room" <> ToString[i]} -> "Integer", {i, #rooms}]]
     }]
    

    Because it is not. Only first page is displayed and it is only refreshed after clicking NEXT button.

  2. Should I be surprised that the FormFunction activated in desktop Mathematica uses $Output to show the form? This causes funny behaviour of form showing in MessagesNotebook if one have such setting for messages/errors/

7634daily.png

  1. Since we are talking about Cloud deployment. Documentation doesn’t seem to be up to date since EmbedCode[CloudDeploy[“hello, world”]] result shown there is a string with an HTML tag while currently, after evaluating the code one gets this interactive panel with iFrame element to copy.

Currently, to get the string I’m using EmbedCode[CloudDeploy[“hello, world”], ImageSize → {200, 200}][1][“CodeSection”, “Content”]. Is this “preferred” way? Shouldn’t this be documented?

I’m sorry if those issues are due to my mistakes but I spent some time to try to resolve them.

I see points 1. 1. 2. … when I want to edit the post I see correct 1.2.3… The preview shows something different that the result.

Let this be a question 4…(3)

Kuba,

Multipage formfunction works fine in the cloud. I tested your code and it works. If I enter 3 in the rooms field it delivers 3 input fields when next is pressed.

CloudDeploy@FormFunction[
  {
   {{"rooms", "number of rooms"} -> "Integer"}, 
   Table[{"room" <> ToString[i], "guests in room" <> ToString[i]} -> 
      "Integer", {i, #rooms}] &
   }]

If you evaluate in the desktop it is also fine. (note the [] at the end to launch the form)

FormFunction[{{{"rooms", "number of rooms"} -> "Integer"}, 
   Function[
    Table[{"room" <> ToString[i], "guests in room" <> ToString[i]} -> 
      "Integer", {i, #rooms}]]}][]

Could you be more specific on what it is that is not working? (I tested 10.1 kernel, win7 64)

Thanks Pieter,

  1. well, maybe it’s a browser related issue. I use the latest Chrome. Do you too?

  2. Do you have Preferences/Messages set to Print to Console?

Kuba

Kuba,

  1. i tested in chrome, firefox and even IE (latest versions) They all run your code

  2. Here are my settings.

(I reported the problem with section numbers.)

This it the point, change to Print to Console and try.

And about multipage form. I will do further test to narrow this down.

Thanks

Thanks, I’d have done this by myself but product feedback form gives an error lately or I’m not getting an automatic case creation confirmation mail at all.

Kuba,

If you get resolution to your problem, please post it here. I tried running your code (copied from Pieter’s post) and was not able to progress to the second page of the multipage form. I am working on a similar project and had this same issue with the example code provided on Wolfram’s Advanced Web Form Creation tutorial. I sent an email to tech support and am currently waiting for a reply. If you find out that it is some sort of settings issue, I’d really like to hear about it.

Thank you