This next example does not work correctly in Internet Explorer; it will add the new option but only the value and not display any text.
I already placed the field for listing state, only want to load the values from ajax. whenever I submit form it shows state (field loaded by ajax) is ' An illegal choice has been detected. How can I update the new option values of field state which I have loaded from ajax call to the drupal form. This would normally be * pulling data from the database.
function mymodule_country_state_city($form, & $form_state, $no_js_use = FALSE) function ajax_example_dependent_dropdown_callback($form, $form_state) function ajax_example_dependent_dropdown1_callback($form, $form_state) /** * Helper function to populate the first dropdown.
Firing and handling the AJAX request is a frontend task, but as I understand you, fetching the options are backend stuff.