<p>Jeff: Have you tried putting the url in the array through the url() function? That sounds like something to try. Possibly with the 'absolute' option set to True.</p>
<div class="gmail_quote">On Dec 30, 2010 5:41 PM, <<a href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a>> wrote:<br type="attribution">> Almost there. I have the ahah appearing now by using #after_build. I <br>
> guess from what I read that this had something to do with CCK fields <br>> (such as content profile fields) not cooperating with hook_form_alter <br>> due to timing.<br>> <br>> My (hopefully) last hurdle is probably just a need for another pair of <br>
> eyes. When the change event fires and the throbber spins, I get a 404 <br>> error on the callback.<br>> <br>> function test_menu() {<br>> $items = array();<br>> $items['test/change_value/callback'] = array(<br>
> 'page callback' => 'test_change_callback',<br>> 'access callback' => TRUE,<br>> 'type' => MENU_CALLBACK,<br>> );<br>> <br>> return $items;<br>
> }<br>> <br>> function test_form_alter(&$form, &$form_state, $form_id) {<br>> if ($form_id == 'test_profile_node_form') {<br>> $form['field_result']['#prefix'] = '<div <br>
> id="field-result-wrapper">';<br>> $form['field_result']['#suffix'] = '</div>';<br>> <br>> $form['#after_build'][] = 'test_add_ahah';<br>
> }<br>> }<br>> <br>> function test_add_ahah($form, $form_state) {<br>> <br>> $ahah = array();<br>> <br>> $ahah['edit-field-test-value'] = array(<br>> 'button' => false,<br>
> 'effect' => 'none',<br>> 'event' => 'change',<br>> 'keypress' => NULL,<br>> 'method' => 'replace',<br>> 'progress' => array('type' => 'throbber'),<br>
> 'selector' => '#edit-field-test-value',<br>> 'url' => 'test/change_value/callback',<br>> 'wrapper' => 'field-result-wrapper',<br>
> );<br>> drupal_add_js(array('ahah' => $ahah), 'setting');<br>> <br>> <br>> return $form;<br>> }<br>> <br>> function test_callback_helper() {<br>> $form_state = array('storage' => NULL, 'submitted' => FALSE);<br>
> $form_build_id = $_POST['form_build_id'];<br>> $form = form_get_cache($form_build_id, $form_state);<br>> $args = $form['#parameters'];<br>> $form_id = array_shift($args);<br>> $form_state['post'] = $form['#post'] = $_POST;<br>
> $form_state['ahah_submission'] = TRUE;<br>> $form['#programmed'] = $form['#redirect'] = FALSE;<br>> drupal_process_form($form_id, $form, $form_state);<br>> $form = drupal_rebuild_form($form_id, $form_state, $args, <br>
> $form_build_id);<br>> return $form;<br>> }<br>> <br>> function test_change_callback() {<br>> <br>> $form = test_callback_helper();<br>> $output= test_do_stuff();<br>> drupal_json(array('status' => TRUE, 'data' => $output));<br>
> exit();<br>> }<br>> <br></div>