Message Boards Message Boards

0
|
6771 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

FormFunction Reload/Refresh Functionality

Posted 9 years ago

Hi all,

What is the most clean way to develop an interactive web form that modifies its own elements with respect to inputs from users?

My code is as follows, I am trying to update "Description" field's text with the choice information:

CloudDeploy[
FormFunction[
"Choice" -> {"A", "B", "C"},
{
AppearanceRules -> <|"Description" -> #Choice|>;
}&,
AppearanceRules -> <|"Title" -> "Choice", "Description" -> "X", "SubmitLabel" -> "Gonder"|>
]
]

Best Regards,

POSTED BY: Mehmet Kaplan
2 Replies
Posted 9 years ago

Dear Sean,

Actually I had already seen that page. I made a double check, it does not match with my question, sorry.

Let me try to give the example in that page:

CloudDeploy[
    FormFunction[
        {
            {"x" -> {"cat", "actress"}}, 
            {
                Switch[#x, 
                    "cat",   "y" -> "CatBreed", 
                    "actress",       "y" -> {
                                                Entity["Person", "AnneHathaway::fkdf7"], 
                                                Entity["Person", "HalleBerry::hj23z"], 
                                                Entity["Person", "LeeMeriwether::863fn"]
                                               }
                 ]
            } &
        },
        #y["Image"] &, "PNG"
    ]
]

That command has a flow like that: First "x" is shown. According to x's content "y" is introduced. And according to y's content an actress search (or catbreed) is done. This algorithm is static, i.e. nothing is "variable".

What I am looking for is something more elastic. Using the same example, I am trying to find a way (hopefully a clean way) to manupulate content of "x".

For example

  • in the first time x will show "cat" and "actress",
  • after the submit it will show "dog" and "your 1. choice was cat" text...
  • after next submit it will say "donkey" and "your 2. choice was dog" text ...

Best regards,

POSTED BY: Mehmet Kaplan

The cleanest way of doing this is to use multiple pages. Please see this discussion:

http://community.wolfram.com/groups/-/m/t/427538

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract