When you submit the form it is recreated server side. This means that the value_options
array for each select element will not contain the value that has been posted (as the options were loaded via AJAX)
So the error "The input was not found in the haystack" could be thought of as "The option you selected was not an option in the select element"
In order to validate the posted values you will need to ensure that you add these options before validation and form population on the server side (i.e before $form->setData($request->getPost())
) when the form is posted.