I have a problem with a simple InputField of type Expression:
DynamicModule[{inputExpr = {{{1, 2}, {4, 3}}, {{1, 4}, {2, 3}}} , result = ""},
Column[{Style["Input:", 12, Blue, Editable -> False],
InputField[Dynamic[inputExpr], Expression, BaseStyle -> {"Input", 12},
ImageSize -> 500],
Button[Style["Calculate", 12, Red, Bold, Editable -> False],
result = inputExpr^2, ImageSize -> 500],
Style["Result:", 12, Red, Editable -> False],
Framed[Dynamic[result], BaseStyle -> {12, PrintPrecision -> 3}, ImageSize -> 500]},
Alignment -> Left]]
When I input a different expression than the default, I get an error when I press the "Calculate" button:
What am I doing wrong? How to create a working input field of Expression type? Note, that I need to run it within the free CDF Player, which has some limitations for InputField.
I tried to use the type Boxes instead of Expression (as here), and it works in the full Mathematica, but not in the free CDF Player.


InputFieldof theStringtype. So I will accept an answer showing at least how to achieve my goal with the full Mathematica (I wish to have the"Input"-like automatic formatting withing theInputField). – Alexey Popkov Sep 28 '22 at 16:56FormatType -> StandardFormalso solves the problem, see my answer. I'm not completely sure whether the default optionFormatType -> InputFormof the"Input"style is a bug or not? – Alexey Popkov Sep 29 '22 at 02:38