Hi cheeser2k.
I see problem. Currently I don’t support plugin because I don’t have free time. Sorry for that.
But I can tell you how you can fix this problem by himself.
Open file:
../flexible-woocommerce-checkout-field-editor/assets/customerJs/app.js
after you must change it how you see at picture:
Url: http://193.124.57.131/woocommerceFieldsEditor/fixproblem.png

-
This reply was modified 9 years, 5 months ago by
heolixfy.
Hi heolixfy
Unfortunately, that hasn’t fixed it. It is breaking the visibility rule of the second text box – it is now always visible, regardless of the parent selection.
I’ll try and explain the problem in psuedo-code:
// prevent validation check against non-visible child fields that are set to required
if (parentSelection != “other”) and (childTextBox.requiredField = true)
{
set childTextBox.requiredField to false;
set childTextBox.visibility to visibilitySetting;
}
if (parentSelection = “other”)
{
set childTextBox.requiredField to requiredSetting;
set childTextBox.visibility to visibilitySetting;
}
I need the “other” textbox to not be validated when clicking Place Order if is a required textbox but isn’t visible. So even though it’s required when visible, it should be not-required when invisible.
Hope that makes sense?
Cheers
cheeser2k
At the my picture I set default value for hidden textbox. It don’t have to break your rule. Try again.
My idea: when field is hidding you set default value for it (when user send form to server field will have default value), if field is showing you set empty value.
Ok, got it working using your way. I was missing the braces surrounding the statements after the if and else instructions.
The remaining side effect is that the order emails contain the Other field entry (I used “n/a” instead of “IsVisible=false”).
I would still prefer you eventually re-write it using my suggested manner though, as that is more logical. And obviously without hard-coding the field name. Hope you can get around to it soon.