Hello,
ACF JS hooks should be hooked at root level (not inside a jQuery click function). Also note that you should use the acf/input/admin_enqueue_scripts PHP hook in order to enqueue your JS file. See documentation.
Here is a JS file example, with the ACF JS hook:
(function($){
if(typeof acf === 'undefined')
return;
acf.addFilter('validation_complete', function(json, $form){
// do something...
return json;
});
})(jQuery);
Note that as explained in my in my previous answer, what you’re trying to achieve is a very custom and advanced development task, since ACF fields aren’t designed to have their required setting disabled on-the-fly, via Javascript.
It’s also a strange UX behavior to have required form fields, which become un-required when the user click on a button. I don’t think I ever seen something like that before.
In theory, you could probably set a custom JS data when the user click on the secondary button, and then retrieve that custom data in the validation_complete hook, to reset errors. It’s all theoretical tho.
I think it would be easier to simply disable all fields “required” settings in the ACF Field Group, and just add your own validation via PHP using acf/validate_value combined with $_POST conditional from above, and recreate your own “required” validation with PHP. So you don’t have to bother with JS.
Please note that I cannot provide any further assistance here, as this forum is dedicated to the ACF Extended plugin support and the topic is slowly sliding into custom ACF development questions.
You can try to reach the Official ACF Support forum, they have some experienced developers who may help you with that task.
Hope it helps!
Regards.