Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I want to assign a regular placeholder as a string, it's very easy: (anything the user types in will automatically be given quotes around it, so when they evaluate the cell str is a string)

 str = "\[Placeholder]"

I just can't get quotes around a named placeholder (not while assigning to a variable, at least):

 str2 = {"\"", Placeholder[ProjectName], "\""}

Any help would be appreciated, thanks in advance!

share|improve this question
I've got it, apologies for the self-answered post. It was treating the "=" as a string that caught me off guard. MakeBoxes[string ], RowBox[{"=", "\"", ToBoxes@Placeholder[enter here], "\""}] – user15921 Jun 17 '14 at 14:10
Please answer your own question if you found the answer :) – Öskå Jun 17 '14 at 14:16
I can't yet, too few rep :( If you'd like, take it and answer in my stead! – user15921 Jun 17 '14 at 14:31
How about now? 6 rep should be enough.. :) – Öskå Jun 17 '14 at 14:32
Thank you very much! Unfortunately, "Users with less than 10 reputation can't answer their own question for 8 hours after asking. " – user15921 Jun 17 '14 at 14:35

It was treating the "=" as a string that caught me off guard.

     RowBox[{"=", "\"", ToBoxes@Placeholder[enter here], "\""}]

Mathematica graphics

share|improve this answer
Even if your code helped you to answer your own question, it doesn't seem to work for me. Can you please fix it? – Öskå Jun 17 '14 at 16:38
Sorry, I'll add full context. In my own code this is written to a new notebook, where the user fills in the placeholder and evaluates to save their input as the variable string. – user15921 Jun 17 '14 at 18:39

Maybe this can help you:

x = "";
InputField[Dynamic@x, String, ContinuousAction -> True]
share|improve this answer
Appending FieldHint -> "Enter Project Name", FieldHintStyle -> Red would make your answer, which is nice, nicer :) – eldo Jun 17 '14 at 22:09
This is pretty spiffy, thanks! I like the aesthetics of the InputFields, but I think placeholders are better for 'savability'; if you fill them out and save the nb the code stays, but with input forms if you close the kernel, you loose what you've typed in. – user15921 Jun 18 '14 at 12:54
@user15921 well, sure context matters here :) – Kuba Jun 18 '14 at 18:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.