一段时间后将文本标签为空白 [英] Label text blank after some time

查看:92
本文介绍了一段时间后将文本标签为空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

3-5秒后,我需要将"记录已成功提交"标签文本留空.我们是否需要为此使用JavaScript代码,否则C#.Net代码可以使用吗?

我找不到这个概念.请帮忙.

我不会为此使用计时器控件,因为这对我来说会更耗时.brmode ="hold"/>

谢谢

Varun Sareen

Dear Friends,

I need to make the "Record Submitted Successfully" label text blank after 3-5 secs. Do we require a JavaScript code for this or C#.Net code will do?

I am not able to find the concept for this. Please help.

I am not gonna use the timer control for this as this will be more time consuming for me.br mode="hold" />

Thanks

Varun Sareen

推荐答案

哦,不同的想法怎么样?

如果所有这些都与表单在同一页面上播放,则应在回发"中复制"Post"之前的所有表单内容;仅添加标签成功提交".从这一刻开始,使用人员将看到帖子的成功以及已经提交的数据.

我建议再进行一次更改:提交"按钮被禁用.

如果用户要为同一页面上的下一次提交"准备数据,则需要先修改数据(提交完全相同的数据是没有意义的).您应该在表单中任何控件的任何更改上捕获事件.更改后,当然会再次启用提交"按钮.

现在是隐藏标签"Submitted success"的正确时机!

JavaScript的实现是显而易见的.只需启用按钮并隐藏表单中每个可编辑控件的事件onChange上的文本即可.

—SA
Oh, how about different idea?

If this is all played on the same page with the form, all the form content before the Post should be reproduced in Post-back; only the label "Submitted Successfully" is added. From this moment the used sees the success of the post and the data already submitted.

I suggest one more change: "Submit" button is disabled.

If the user wants to prepare data for next Submit on the same page, she/he needs to modify data first (submitting exact same data makes no sense). You should capture the event on any change of any control in the form. As soon as anything changes, "Submit" button is enabled again, of course.

And this is the right moment to hide the label "Submitted successfully"!

Javascript implementation is obvious. All it takes is to enable button and hide text on the event onChange of each of the editable controls in the form.

—SA


在澄清之后,我想解释一下为什么这种设计非常糟糕并且永远不应该使用.我什至称它为设计错误.

屏幕上显示的所有内容均应具有功能性目的.不应仅显示单个像素进行装饰.我认为,这是工业设计的首要原则.屏幕在3秒钟内发生了变化,这意味着它应该表明到那时或更早时系统中确实发生了变化.显然,它不能用任何固定的时间量来度量.该更改应该有一个目的,否则这将使用户分心.

如果显示出与目的相反的东西,那就更糟了.

想象一下.用户单击提交".没有一些视觉反馈,用户不确定提交操作是否完成或什至被请求.在成功提交"之后,用户很有信心. 3秒后,情况发生了变化:标签消失了,没有任何用户的活动.怎么理解呢?成功归结为不成功吗?

这并不坏.我描述了用户一直观看屏幕时的情况.但为什么?用户不想要它;用户知道:该帖子将花费一些时间,因此用户认为:我的工作暂时完成了!我正在等待响应,可以转身去喝点咖啡;然后我会记得回头监视并检查我单击提交"是否成功…".

…我什至都不敢想象如果这种暂停持续3-5秒以上会发生什么情况.

结论:废弃此效果,甚至不要再使用它了!

感谢您的理解,
-SA
After clarification I want to explain why this design is very bad and should never be used. I would even call it a design bug.

Everything what''s shown on screen should have a functional purpose. Not a single pixel should be shown just for decoration. In my opinion, this is the first principle of industrial design. Is something changes on screen in 3 sec, it means it should indicate something has really changed in the system by that time or a little earlier. It''s clear that it cannot be measured by any fixed amount of time. That change should have a purpose, otherwise this is garbage distracting the user.

Much worse if something is shown against the purpose.

Picture this. The user clicks on "Submit". Without some visual feedback, the user is not sure that Submit operation is complete or even requested. After "Submitted Successfully" the user is confident. After 3 sec something changes: the label disappears, without any user''s activity. How to understand that? Success reverted to non-success?

This is not the worse. I described the scenario when the user watched the screen all the time. But why? The user does not want it; the user knows: the post will take a bit of time, so the user thinks: "My job is done for the moment! I''m waiting for response and can turn away to drink some of my coffee; then I''ll remember to turn back to monitor and check up that my click on "Submit" worked out…".

…I''m afraid to even imagine what happens if this pause lasts more than 3-5 seconds.

Conclusion: trash this effect and don''t even play with the idea of using it again!

Thank you for understanding,
—SA


您尝试过(/愿意尝试)jQuery淡出吗?
http://stackoverflow.com/questions/2275007/how-to-create-a-fading-label-in-jquery-asp-net-after-a-button-press [
Did you try(/willing to try) jQuery fadeout?
http://stackoverflow.com/questions/2275007/how-to-create-a-fading-label-in-jquery-asp-net-after-a-button-press[^]


这篇关于一段时间后将文本标签为空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆