I'm trying to modify the user_profile_form, but it isn't working. My regular user edit information shows up, but not my profile2 information.
function MY_MODULE_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_register_form' || $form_id == 'user_profile_form') {
$form['#attached']['js'][] = drupal_get_path('module', 'conduit') . '/js/jvectormap.min.js'; // You should place jvectormap js files into MYMODULE/js folder
$form['#attached']['js'][] = drupal_get_path('module', 'conduit') . '/js/jquery-jvectormap-mi-counties.js'; // This is US counties generated file (see #1).
$form['#attached']['js'][] = drupal_get_path('module', 'conduit') . '/js/county-select.js';
$form['mi_container'] = array(
'#type' => "container",
'#states' => array(
'visible' => array(// action to take.
'select[name="profile_main[field_states][und]"]' => array('value' => 187),
),
),
);
$form['mi_container']['micounties_markup'] = array(
'#markup' => '<div id="micounties" style="width: 600px; height: 400px"></div>', // Define own width and height.
);
}
}
Why wouldn't this work?