Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(#my_form_id).submit(function (){
- parent.window.location="/user/register";
- });
- $form['submit'] = array(
- '#prefix' => '<div id="super-cool-wrapper"></div>',
- '#type' => 'button',
- '#value' => 'Submit',
- '#ajax' => array(
- 'callback' => 'my_super_cool_ajax_callback',
- 'wrapper' => 'super-cool-wrapper',
- 'method' => 'replace',
- ),
- );
- function my_super_cool_ajax_callback($form, $form_state) {
- // Do what you normally would with the form submission.
- return '<script type="text/javascript">
- parent.window.location="some/where";
- </script>';
- }
- function mymodule_showmodal($js) {
- ctools_include('modal');
- ctools_include('ajax');
- $form_state = array(
- 'ajax' => true,
- );
- $commands = ctools_modal_form_wrapper('modform',$form_state);
- if ($form_state['executed']) {
- $commands = array(ctools_modal_command_dismiss());
- }
- print ajax_render($commands);
- exit();
- }
- function my_module_node_presave($node){
- if ($node->type == 'product'){
- $GLOBALS['redirect_parent'] = 'product_list';
- }
- }
- function my_module_drupal_goto_alter(){
- if (@$GLOBALS['redirect_parent']!=''){
- die('<script type="text/javascript">parent.window.location="/'.$GLOBALS['redirect_parent'].'";</script>');
- $GLOBALS['redirect_parent']='';
- }
- }
- <?php
- echo l('Sign up here', 'user/register', array('query'=>array('destination'=>'thanks')));
- ?>
- <?php
- print l('Forgot Your Password?', 'user/password', array('query'=>array('destination'=>'thanks')));
- ?>
Add Comment
Please, Sign In to add comment