1
$\begingroup$

Here is a basic example:

{InputField[Dynamic[x]], Dynamic[x]}

This code generates an input box with and dynamic display. enter image description here

What is disturbing me is that when trying to enter some complex expressions, MMA automatically calculates and updates it in the input box. Is there any way to keep the expression in the input box remains unevaluated?

e.g. If I enter Exp[2.1]:

enter image description here

after I clicked somewhere else, the content of the input box turns into the result immediately, but I want the result to be displayed only beside the input box. enter image description here

$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ Commented Mar 17, 2015 at 16:35

1 Answer 1

3
$\begingroup$

You are looking for this:

{InputField[Dynamic[x], Hold[Expression]], Dynamic[ReleaseHold[x]]}

example

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.