Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Comments
Sergey Alexandrovich Kryukov 21-Feb-11 0:57am    
Bad idea, makes no sense. Or you can explain why?
Ankur\m/ 21-Feb-11 1:25am    
Reply from OP:
When i click on the submit button and the record is saved successfully then a label shows at the top that "Record Submitted Successfully". I want this text to fade out or be blank (not visible to the user after a specified time interval
Ankur\m/ 21-Feb-11 1:27am    
Use 'Reply' link (which can be seen when you mouse over a comment) to reply to a comment because that will notify the user and adding a comment below your answer won't.
Varun Sareen 21-Feb-11 1:36am    
thanks dear ankur
nagendrathecoder 21-Feb-11 2:11am    
Rather doing this, you can display a message box to user for notifying successfull record submission.
This message box will be closed after user clicks on it.

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
 
Share this answer
 
v4
Comments
m@dhu 21-Feb-11 2:37am    
I think this is bit more coding to check the changes has been made in the page or not.
May not be the better solution but if the op wants to hide the label using a progress bar should work.
Sergey Alexandrovich Kryukov 21-Feb-11 2:44am    
No. This is less, not more coding, few lines. No check is needed. Please see my update.

What progress bar? There are only 3 states: not submitted, submitted with data unmodified and then data modified. For a progress bar, there are not triggering event. OP's solution is absolutely wrong, just showing a label is OK and my scenario is better.

--SA
Varun Sareen 21-Feb-11 4:27am    
Dear SAKryukov,

What all you have written in your answer is absolutely fine but now as the code on which i am working is given by one of our vendor so for the launching of first version of my application I have to make a lot of changes in the code part. So, It's better to move on with this version of code :)
Sergey Alexandrovich Kryukov 21-Feb-11 11:32am    
Dear Varun,

You understand that this is your decision and your responsibility; you don't need to give me any excuses of not following my advice; however, the mere fact that you're trying to explain to me about urgency of your version give me the idea that you're still not sure. This is good. My this is just to warn you that you would probably drive your users crasy. I don't understand what "lot of changes" do you mean, I though the minimum you should do to help the situation is simply giving up that disappearing label. You don't want all that trouble it would make.

Thank you for understanding.

--SA
Espen Harlinn 21-Feb-11 9:44am    
Good advice, my 5
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
 
Share this answer
 
v7
Comments
m@dhu 21-Feb-11 2:09am    
Have my 5.
Sergey Alexandrovich Kryukov 21-Feb-11 2:12am    
Thank you.
--SA
Varun Sareen 21-Feb-11 4:24am    
I perfectly agree dear. But the code i got from our vendor is like this only so I have to move on with this only but i am planning to do a lot better in second version of my application :).
Sergey Alexandrovich Kryukov 21-Feb-11 11:34am    
I commented it at my other answer.
Thank you for accepting my answer.

Good luck,
--SA
Sergey Alexandrovich Kryukov 21-Feb-11 2:25am    
I got better idea, please see my other Answer.
--SA
 
Share this answer
 
Comments
fjdiewornncalwe 21-Feb-11 8:52am    
I'll 5 this. It would be a relatively simple solution.
Espen Harlinn 21-Feb-11 9:45am    
Good link, my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900