2016-08-14 30 views

回答

0

試試這個:

function(item) { 
    alert("Handler for .submit() called."); 
    item.preventDefault(); 
    // rest of the code 
} 

OR

$("#form_id").validate({ 
     submitHandler: function (form) { 
      // do code 
      return false; 
    }}) 
+0

@ user3287550它的確如此。 –

0

既然你用jQuery標記你的問題。

$('form').submit(Popup); //this inside the function is the form. 
         // The first parameter is the event. 

,並確保從Popup

返回false如果Popup不是構造函數,使用駝峯命名

0

你現有的代碼應該工作,如果你只是修改它只是有點。添加returnPopup方法調用

<form onsubmit="return Popup(this)"> 

而在你的方法聲明的末尾添加return false

Popup: function(item){ 
      // your code goes here 
      return false; //add this 
     }