Message Boards Message Boards

0
|
18676 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Using InputField in a CDF

Posted 11 years ago
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
3 Replies
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
CDF does not allow input fields because if you could you could create a free version of Mathematica using the CDF player.
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
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