简体   繁体   English

有什么好的建议来提醒/提醒用户在网页上编辑字段后要保存?

[英]Any good suggestions to alert / remind user to save after editing field on a web page?

I have an asp.net-mvc site and a page that has a large number of editable fields table rows, etc that all can be edited. 我有一个asp.net-mvc网站和一个页面,其中包含大量可编辑字段,表行等,所有这些行都可以编辑。 Because the page is quite long the save button often is not visible on the screen given screen size. 由于页面很长,因此在给定屏幕尺寸的情况下,保存按钮通常在屏幕上不可见。

We have run into issues where people have said they go in an make changes but they forget to click "save" because its not obvious on the screen. 我们遇到了一些问题,人们说他们要进行更改,但是他们忘记单击“保存”,因为它在屏幕上不明显。 I want a solution that visibly reminds the user once they make changes that those have not been persisted yet until they click save. 我希望有一个解决方案能够在用户进行更改后明显提醒用户在单击保存之前尚未持久保存这些更改。

Is there any recommended best practice / examples for doing something like this? 是否有建议的最佳做法/示例来做这样的事情?

I would personally implement a notification popup eg Bootstrap Notify . 我将亲自实现一个通知弹出窗口,例如Bootstrap Notify I would create some JS to execute the notification this after X minutes. X分钟后,我将创建一些JS来执行通知。

I like to show a bootstrap alert. 我喜欢显示引导警报。 I position the alert absolutely to show on the top of my page like this: 我将警报定位为绝对显示在页面顶部,如下所示:

在此处输入图片说明

I use a helper object JSFiddle 我使用辅助对象JSFiddle

(function() {

    var notify = new Notify({
        container: document.getElementById('alerts'),
        template: `<div class="alert alert-{{type}}" role="alert"><div class="text-center">{{message}}</div></div>`
    });

    notify.danger('Some error message');

}());

You can have a toastr that will pop up in the screen like this: 您可以有一个在屏幕上弹出的烤面包机,如下所示:

<script>
$(document).ready(function () {
    toastr.options.showMethod = 'slideDown';
    toastr.options.closeButton = true;
    toastr.info('Don't forget to save');

    {

    }
});
</script>

And in the bundle config do this: 并在bundle配置中执行以下操作:

bundles.Add(New StyleBundle("~/Content/css").Include("~/Content/bootstrap.css",
        "~/Content/toastr.css"));

bundles.Add(New ScriptBundle("~/bundles/jquery").Include(
        "~/Scripts/jquery-{version}.js",
        "~/Scripts/toastr.js"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM