Hello,
This maybe a topic repost, but i couldn't find any records of the same thread or topic in google..
well heres my problem;
Im using ahah submit to enable the progress bar; because updating 1500++ records and initiating about 3000++ queries it could take awhile when a user click on the submit button; HENCE
i've implemented an ahah submit button code below;
---------------
$form['target'] = array(
'#type' => 'markup',
'#prefix' => '',
'#value' => t('To Synchronise your CLI address allocation please click Upload below.'),
'#suffix' => '',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Upload'),
'#ahah' => array(
'event' => 'click',
'path' => 'esa/clicron/usermulti',
'wrapper' => 'target',
'effect' => 'fade',
'progress' => array('type' => 'bar', 'message' => t('Please wait...'), 'interval' => 0, 'url' => $progressURL.'esa/cron/progress') ,
),
---------------
Once submitted and all the processes have been executed the end code would be this & progress is 100%;
--------
.......
$output = t("Done");
drupal_json(array('status' => TRUE, 'data' => $output));
----------
i understand that by doing this it will only change the content in the div box (class=Target)
What i really want is to redirect it back to the main page or redirect it somewhere;
I tried drupal_goto + form_state['redirect'] will also wont work
any idea. Hope im not too vague
Thanks in Advance :D
Comments
Same here
I'm trying to do the same thing, I'd like to use ahah for validation on a search form, so errors happen in-page but valid searches go to a new page.
Is there another approach we should be trying here?
try this: In your menu
try this:
In your menu callback for AHAH.
$output .= "< script type='text/javascript'>\n";
$output .= "window.location = 'http://www.example.com/';\n"; // your path
$output .= "< /script>\n";
drupal_json(array('status' => TRUE, 'data' => $output));
just ignore the space after "<"
I don't know if this is a dirty way but hope this helps.
It's work for me
Yes.. thanks, it's work fine for me