Build and update a form based on another form On the checkout page, I wish to load a form on a modal whose data depends on the uc_addresses select address drop-down.

I have declared a form through hook_form and add the form to the checkout page through mymodule_form_uc_cart_checkout_form_alter:

  $form['panes']['delivery']['modal'] = drupal_get_form('form_id');


My question is: how will I rebuild the form when a different drop-down option is selected? Note that I have tried to add a parameter in hook_form:drupal_get_form('form_id', 'address_id') my problem is the form rebuild when the option is changed.
You could possibly use the #states API to react upon another option in the dropdown is selected, this will work without submits on the client side.

If you want to change your form after submission has happened only you'd have to add conditions in your custom form function that will change your form dynamically according to what is contained in the $form_state['values'] of that dropdown field.