Closed hardikmehta09 closed 6 years ago
Hi @hardikmehta09,
Glad you like the package!
The first problem is caused because the value isn't "Other" when you pick multiple values; it's "Other,[more values here]" or possibly "[more values here],Other" - depending on the order of which you click the checkboxes. The thing is that a checkbox groups isn't a standard HTML form field like a radio button group, so implementations of it don't really behave as nicely as standard form fields.
You might be able to solve the first problem by creating a custom condition that lets you do "Value contains" conditional logic. Alternatively switch to a radio button group if you can.
The second problem is easier to solve. You shouldn't make the "Other Value" field required, because as you say - the form won't submit without a value in it. Instead you need to use conditional validation to make a field conditionally required. See this tutorial.
Note that if you end up solving the first problem with a custom condition, that same custom condition will be applicable for conditional validation as well.
Closing this due to lack of activity.
I've got the logic for .Contains, would you like me to create a PR?
It's pretty straight forward, we just use indexOf
in the front-end code, and use .Contains in the C#.
Hi @kjac ,
I have tried FormEditor and it is very beautiful tool you have created and it is very useful for me.
But I am facing one problem with "checkbox group" control.
I have added one item "Other" and I want to show a textbox on selection of "Other" which is "Other Value" Textbox.
For that I have added action that when value of Question is "Other" it will show "Other Value" Textbox for me but when I am selecting another value with "Other" it will become disabled and not allow me to select multiple values like "Bank to bank transfer" and "Other" both with "Other Value" Textbox.
And There is one more problem I am facing It will not allowing me to submit form if I have selected only one value "Bank to bank transfer" Because "Other Value" Textbox is set required. The reason behind set it to required is it will not validate and wait for user to input something in "Other Value" Textbox if he/she has selected "Other" option. And if I remove required from "Other Value" Textbox then it will submit the form though user has selected "Other" option