簡體   English   中英

在成功時自動掛鈎

[英]Autoform Hooks onSuccess

我在使自動成型掛鈎正常工作時遇到問題。 目前,我正在使用此快速表格。

{{>quickForm id="studentForm" collection="Students" type="insert" template="bootstrap3-horizontal" label-class="col-sm-3" input-col-class="col-sm-9"}}

我希望成功提交表單后顯示成功消息。 目前,我有一個使用此代碼的事件:

Template.home.events({
    "submit #student-form": function(event) {
        event.preventDefault();
        swal("Success!", "You have been added to the WaitList", "success")
    }
});

我試圖像這樣使用autoform鈎子:

AutoForm.hooks({
    studentForm: {
        onSuccess: function(insert, result) {
            swal("Success!", "You have been added to the wait list", "success")
        }
    }
})

目前,這對我不起作用,我為為什么不起作用而感到困惑。 自動成型掛鈎的文檔在這里

對我的問題有什么想法嗎?

它顯然已被事件的preventDefault()阻止。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM