How to register a field at specific position or at the position from where it unregistered? #10089
Unanswered
ArchanaSharma95
asked this question in
General
Replies: 1 comment 4 replies
-
Could you please explain why you need to keep order of form field values ? The form values can be in any order as it just a data source, order of field should be handled in UI a.k.a presentation layer. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm working with a form where one field depends on another. If field1 is enabled then I need to hide the field2. Now the problem is I am using "unregister" to hide "field2" when "field1" is enabled and then again register the "field2" when "field1" will again turn to enable.
What happened here::
My form object default values::
{
field0:"",
field1: false,
field2: false,
field3: "",
field4: ""
}
After unregister: I have turned "field1" to true and then unregister the "field2"
{
field0:"",
field1: true,
field3: "",
field4: ""
}
After register: I have turned "field1" to false and again register the "field2"
{
field0:"",
field1: false,
field3: "",
field4: "",
field2: false
}
WHAT I expect after turning "field1" to false(after first enable and then disable):
{
field0:"",
field1: false,
field2: false, // Need field2 at its position from where we have unregister it
field3: "",
field4: ""
}
Is this possible using this form? Please help!
Beta Was this translation helpful? Give feedback.
All reactions