2014-09-01 65 views
1

我想顯示的fancybox提交後form.Here是我的代碼開放的fancybox後提交表單

 <form method="get" action="http://test.net/test/test-register-auto.php" id="signup"> 
      <div class="form-header"> 
       This is for test 
      </div> 
      <div class="inputs"> 
       <input readonly="readonly" name="firstname" class="form-input" value="test3" placeholder="Enter Your First Name" autofocus="" type="text" /> 
       <input readonly="readonly" name="email" value="test2" class="form-input" placeholder="Enter Your Email Address" type="email" /> 
       <select name="countrycode" disabled name="countrycode" class="form-dropdown"> 
        <option selected="selected" value="test">test</option> 
       </select> 
       <input name="phonenumber" readonly="readonly" value="test class="form-input" placeholder="Your Phone Number" type="text" /> 

       <input type="submit" class="button-1" value="REGISTER NOW" /> 

      </div> 
     </form> 

這裏是我的jQuery代碼

<script type="text/javascript"> 
    $(function() { 
     $("#signup").submit(function() { 

      $form = $(this); 

      fancybox({ 
       'width': '100%', 
       'height': '100%', 
       'autoScale': false, 
       'transitionIn': 'none', 
       'transitionOut': 'none', 
       'type': 'iframe', 
       'href': 'http://google.com' 
      }); 
      return false; 

     }); 

    }); 
</script> 

後按下按鈕提交數據建議立即進行刪除是打開一個fancybox,我嘗試了很多時間,但沒有運氣! 任何人都可以在這方面幫助我嗎?

+0

這個'fancybox({...})'應該是'$ .fancybox({...})' – JFK 2014-09-01 21:46:27

回答

0

也許你忘了指定要包含的fancybox內容您可以試試元素,像

$("#container_box").fancybox({ 
    'width': '100%', 
    'height': '100%', 
    'autoScale': false, 
    'transitionIn': 'none', 
    'transitionOut': 'none', 
    'type': 'iframe', 
    'href': 'http://google.com' 
});  
+0

nope,OP需要在提交後以編程方式打開fancybox。你的代碼只綁定fancybox到一個選擇器,它仍然需要一個'click'事件來激發fancybox – JFK 2014-09-01 21:48:16

0

<script type="text/javascript"> 

$(函數(){ $(」 #signup「)。submit(function(){

 $form = $(this); 

     $.fancybox({ 
      'width': '100%', 
      'height': '100%', 
      'autoScale': false, 
      'transitionIn': 'none', 
      'transitionOut': 'none', 
      'type': 'iframe', 
      'href': 'http://google.com' 
     }); 
     return false; 

    }); 

});