I get the error "Illegal choice" when I submit a form with a multi-select option that was freshly created via ajax. Workflow is like this:
- User loads node edit form
- User needs to select a non-existant job title (job titles are drupal taxonomy terms)
- User presses my custom ajax button that (1)takes their new title, (2) adds their new title as a drupal term, (3) updates the form in the browser, (4) selects the new title
When I submit the form, drupal doesn't seem to see that the new title has a corresponding (therefore valid) TID and errors out in the validation.
I tried creating custom validation on the title element, but despite passing that validation, drupal still does its own check, which fails.
Anyone know how to work around this?