I have two radio buttons: Private and Business when the user select private button I and to remove the validation from an specific input field: Full name, and if user select private again, it just come it back. Is there a way to programmatically change if the field is required? I added this fields to the checkout using layout processor:
$customField = [
'component' => 'JCustom_FullName/js/togglepersontype',
'config' => [
'customScope' => 'shippingAddress',
'template' => 'ui/form/field',
'elementTmpl' => 'JCustom_FullName/radio'
],
'dataScope' => 'shippingAddress' . '.' . $customAttributeCode,
'label' => __('Tipo de entidade:'),
'provider' => 'checkoutProvider',
'sortOrder' => 0,
'validation' => [
'required-entry' => false
],
'options' => [],
'filterBy' => null,
'customEntry' => null,
'visible' => true,
];
What happens when a field is filled with required-entry => true? Can I change it to false/true using JavaScript?