2012-12-12 20 views
0

我使用它來捕獲表單上的事件。顯示通知當表單項更新時

$('.my-form input[type=checkbox]').click(function() { 
    var CurrectForm=$(this).parents('.my-form:first'); 
    $.post(
     'go.php', 
     CurrectForm.serialize(), 
     function(response) { 
      CurrectForm.find('#form-response').html(response); 
     } 
    ); 
}); 

$("select").change(function() { 
    var CurrectForm=$(this).parents('.my:first'); 
    $.post(
     'go.php', 
     CurrectForm.serialize(), 
     function(response) { 
      CurrectForm.find('#form').html(response); 
     } 
    ); 
}); 

任何時候單擊複選框或更改下拉列表時,值都會傳遞給go.php並更新MySQL DB。

有沒有什麼方法可以在屏幕上顯示「已成功更新」通知? 我一直在看:http://akquinet.github.com/jquery-toastmessage-plugin/demo/demo.html 它確實做我想做的。

但是,我將它添加到我的主頁或go.php,以及如何?

謝謝:)

+1

你有沒有通過閱讀和理解文檔得到了這個工作通過toastmessage提供? https://github.com/akquinet/jquery-toastmessage-plugin/wiki – Jason

+0

嗨。我將jquery.toastmessage-min.js和配置代碼添加到頭中,並使用顯示的成功示例調用toastmessage。什麼都沒發生。我會在一個獨立的腳本上嘗試它,看看是否有效。 – MacMan

+0

我有這個工作很好獨立,我會在週末將它添加到我的主要腳本。 – MacMan

回答

0

我已經通過調用通知功能後

function(response) { 
      CurrectForm.find('#form').html(response); 
     } 

這是現在的工作,因爲我想:)