0

Would appreciate help on a design strategy.

On a form I have an auto complete text field that I would like to populate with two separate values based on a radio button selection.

Currently the first radio button is loaded via an ajax call on load via hook_menu.

function hook_menu() {
$items = array();

$items['module/state_autocomplete'] = array(
        'page callback' => 'state_autocomplete',
        'access arguments' => array('create states'),
        'type' => MENU_CALLBACK,);

Can I attach an ajax call to an on change event that will reload the text field without reloading the page?

For example: enter image description here

0

Can I attach an ajax call to an on change event that will reload the text field without reloading the page?

If that's your question, then the answer is yes, you can.

If you meant to ask how to do that, then please refer to Ajax Forms documentation for Drupal 8 or Drupal 7.

If you hit any problem when implementing it, then come back giving us the details of specific issue as provided information does not describe what the problem is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.