2011-08-10 4 views
1

私はjqueryモーダルの確認ボックスを持っています、私はレジスタとログインボタンを追加しました(私はマニュアルから1つをコピーしました)..今問題は、jqueryモーダル確認ボックスボタン機能、お助けください?

1)私はしたい登録ボタンをクリックして別のポップアップボックス、およびこのポップアップを表示するには、 は、AJAXパワードモジュールのポップアップが現れたら

  <div id="registerpopup"> 
      <?php 
      if($_GET['t']=='l') 
       { 
        $the_class->Lostpword('pword_embed'); 
       } 
      elseif($_GET['t']=='b') 
       { 
        $the_class->Lostpword('unamepword_embed'); 
       } 
      elseif($_GET['t']=='n') 
       { 
        //$the_class->Lostpword('pword_embed'); 
        $the_class->Registration('unamepword_embed_next'); 
       } 
      elseif($_GET['t']=='r') 
       { 
        //$the_class->Lostpword('pword_embed'); 
        $the_class->Registration('register_embed'); 
       } 
      else 
       { 
        $the_class->Lostpword('accn_help'); 
       } 
       ?> 
      </div> 

2)は、その後、確認ボックスが閉じ、このAJAXパワードモジュールを含まなければなりません。
3)ユーザーが正常に登録されたとき、この新しいポップアップを閉じてページを自動的に更新する方法。なぜなら、アプリケーションの登録ユーザーはすべて自動的にログインする必要があるからです。

は、ここで私は私の最初の投稿を編集した私の確認ボックスコード

if(userid == ""){ 
     $("#dialog:ui-dialog").dialog("destroy"); 

     $("#dialog-confirm").dialog({ 
      resizable: false, 
      height: 230, 
     width: 350, 
      modal: true, 
      buttons: { 
       "Register": function(){ 
       $(this).dialog("close"); 
       }, 
       "Log in": function() { 
        $(this).dialog("close"); 
       } 
      } 
     }); 
    return false; 
} 

答えて

1
// Inside confirm modal code 
// On click of register button... 
$('#confirm_register_btn').click(function(){ 
    // ... close the confirm box 
    $('#confirm_box').hide(); 
}); 

// Inside register modal code 
$.ajax({ 
    url: '/path-to-register.php', 
    data: ... 
    dataType: ... 
    type: 'post', 
    success:function(data){ 
     // Example, data = 'Registration successful' 
     // Let the user know... 
     $('body').html(data + ' -- Please wait while we redirect you'); 

     // Reload page 
     window.location.reload(); 
    } 
}); 
+0

だ、あなたは私が持っているjqueryのモーダル確認ボックス内、私がやりたいか、確認してくださいすることができますか? – sasori

+1

このフィドルをチェックしてください:http://jsfiddle.net/AlienWebguy/axLPE/ – AlienWebguy

関連する問題