Here is a 2-step webform. After the first step I need validation. v1x, v1y, v1z must be different numbers. If for example v1x and v1z contain the same number I need an error message to appear.
here is a 2 step form:
CloudDeploy[
FormFunction[
{FormObject[
<|"v1x" ->
<|"Interpreter" -> {"Most" -> 1, "Least" -> 2, "Excluded" -> 0},
"Control" -> RadioButtonBar, "Default" -> 0|> ,
"v1y" ->
<|"Interpreter" -> {"Most" -> 1, "Least" -> 2, "Excluded" -> 0},
"Control" -> RadioButtonBar, "Default" -> 0|> ,
"v1z" ->
<|"Interpreter" -> {"Most" -> 1, "Least" -> 2, "Excluded" -> 0},
"Control" -> RadioButtonBar, "Default" -> 0|>
|>],
FormObject[
<|"v2x" ->
<|"Interpreter" -> {"Most" -> 1, "Least" -> 2, "Excluded" -> 0},
"Control" -> RadioButtonBar, "Default" -> 0|> ,
"v2y" ->
<|"Interpreter" -> {"Most" -> 1, "Least" -> 2, "Excluded" -> 0},
"Control" -> RadioButtonBar, "Default" -> 0|> ,
"v2z" ->
<|"Interpreter" -> {"Most" -> 1, "Least" -> 2, "Excluded" -> 0},
"Control" -> RadioButtonBar, "Default" -> 0|>
|>]
}
, Identity],
"test"]
I did have studied this approach but this only provides validation for 1 var each time. I need to compare 3 values per step in the form before continuing to the next step.
toObject[s_String] /; ToUpperCase[s] == s := myObject[s];
toObject[s_] :=
Failure["InterpretationFailure", <|
"MessageTemplate" -> "please insert an uppercased string"|>];
CloudDeploy [
FormFunction[FormObject[{"x" -> toObject}], Identity], "/test"]
suggestions ?