Group Abstract Group Abstract

Message Boards Message Boards

Using InputField in a CDF

GROUPS:
Hello All,

I've deployed the following piece of code on the web as a cdf.
Manipulate[Dynamic, {u, "xxx"}, ControlType -> InputField]

In its deployed form it will show things like "Test" when they are entered, but single letters such as "d" won't evaluate. Does anyone have an idea of what is causing this odd behavior.

Thanks,
Tripp
POSTED BY: Tripp Lybrand
Answer
9 months ago
The code above looks like it might be incomplete. Is that code you posted the correct code?

Additionally, do you see this behavior when previewing the Manipulate as a CDF in Mathematica? To do this, evaluate the statement and go to  File > CDF Preview > CDF Player.
Mathematica should now act as though it were the CDF player.
POSTED BY: Sean Clarke
Answer
9 months ago
CDF does not allow input fields because if you could you could create a free version of Mathematica using the CDF player.
POSTED BY: Christopher Wolfram
Answer
9 months ago
I suspect that the code you mean to write was something like the following:

Manipulate[Dynamic, {u, "xxx"}, ControlType -> InputField]

The resulting Manipulate, when exported as a CDF, exports fine.  Howerver the input field will only work if a numerical value is written into it: not if it has a string in it.

To clarify Christopher's comment.  Free CDFs only allow input fields to have numerical values input into them. If one were to allow string values in the input field then within the Manipulate one could use ToExpression to replicate many aspects of the Mathematica FrontEnd.

See the following table for the limitations of the free CDF player.

http://www.wolfram.com/cdf/adopting-cdf/cdf-and-mathematica-comparison.en.html
POSTED BY: David Reiss
Answer
9 months ago