Drupal 7 dynamic dropdown list options An illegal choice has been detected
The value you are submitting was not present during the page or form loading time. 

If you populate some values using ajax which was not present in initial page loads and try to submit the form, then Drupal will not allow you to submit the form. It will always shows "An illegal choice has been detected" message.