I know that this should be very easy, but I can’t seem to find the answer searching the docs or the discussions. Sorry.
How do I limit the width of input boxes in codes such as below? I only want each box to be about 4 characters wide.
FormPage[{"x1" -> "Number", "x2" -> "Number", "x3" -> "Number", "y1" -> "Number", "y2" -> "Number", "y3" -> "Number"}, fn,
FormLayoutFunction -> Function[Grid[
{{"dependent", #["x1", "Control"], #["x2", "Control"], #["x3", "Control"]},
{"independent", #["y1", "Control"], #["y2", "Control"], #["y3", "Control"]}}]]]
Currently it looks like this:
Thanks in advance,
Mark Greenberg
dreiss
(David Reiss)
August 4, 2016, 8:57pm
2
Something like this perhaps:
FormPage[{"x1" -> <|"Interpreter" -> "Number",
"Control" -> Function[InputField[##, ImageSize -> 25]]|>,
"x2" -> <|"Interpreter" -> "Number",
"Control" -> Function[InputField[##, ImageSize -> 25]]|>,
"x3" -> <|"Interpreter" -> "Number",
"Control" -> Function[InputField[##, ImageSize -> 25]]|>,
"y1" -> <|"Interpreter" -> "Number",
"Control" -> Function[InputField[##, ImageSize -> 25]]|>,
"y2" -> <|"Interpreter" -> "Number",
"Control" -> Function[InputField[##, ImageSize -> 25]]|>,
"y3" -> <|"Interpreter" -> "Number",
"Control" -> Function[InputField[##, ImageSize -> 25]]|>}, fn,
FormLayoutFunction ->
Function[Grid[{{"dependent", #["x1", "Control"], #["x2",
"Control"], #["x3", "Control"]}, {"independent", #["y1",
"Control"], #["y2", "Control"], #["y3", "Control"]}}]]]
Yes. Wow! I never would have come up with that on my own. I’m glad I asked. Thank you, David. It works perfectly.
dreiss
(David Reiss)
August 6, 2016, 12:19pm
4
…delete…
(one day there will be a way to delete one’s post from the forum… )
dreiss
(David Reiss)
August 6, 2016, 3:02pm
5
Well, I had to do some digging through the Documentation Center to accrete insight. And I ultimately found it in the Documentation for FormFunction under scope/controls in this example:
CloudDeploy[
FormFunction[{"x" -> <|"Interpreter" -> "String",
"Control" ->
Function[
Tooltip[InputField[##],
EntityValue[Entity["Species", "Species:FelisCatus"],
EntityProperty["Species", "Image"]]]]|>}, func]]
Since there’s an explicit InputField there I just had to use this example as a hint for the answer I gave you.