I have defined a function
logicalInputField[i_, fieldSize_, numberOfFields_, enable_,tx_,symbol_] :=
Column[{InputField[Dynamic[tx[[i]]], Number, ImageSize -> fieldSize,
Enabled -> enable, ContinuousAction -> True],
Dynamic[If[TrueQ[tx[[i]] == ""],
(symbol[[i]] = "Please Enter"),(symbol[[i]] ="Right")
] ]}]
I am calling this function here.
DynamicModule[
{s = {}},
For[i = 1, i <= 3, i++,
With[{i = i},AppendTo[s, logicalInputField[i, {50, 20}, 3, True,{"", "", ""}, {"Please Enter", "Please Enter", "Please Enter"}]]]];
Panel[ Row[s]]]
I want to ask whenever I am not giving tx and symbol as an argument at the time of defining function. and then calling it, it works fine. But, as soon as I enter some value in InputField
, it gives error message
Set::setps: {, ,} in the part assignment is not a symbol.
Why? How can I call the Part
of a variable from the user defined function.
Panel
. $\endgroup$If[TrueQ[tx[[i]] == ""], (symbol[[i]] = "Please Enter"),(symbol[[i]] ="Right") ]
doesn't give back a value.symbol[[i]] =
should be deleted here. $\endgroup$