Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Messagebox autohide

Questions related to using nuBuilder Forte.
Post Reply
Timo
Posts: 221
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Messagebox autohide

Unread post by Timo »

After a form has been saved, I display a message with nuMessage("Saved + other information..."]);. Now it would be nice if the message would go away on its own after a second. Is that possible?
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Messagebox autohide

Unread post by admin »

Timo,

The reason the message stays there is that sometimes a user might need to copy it when its still on the screen.

Steven
Timo
Posts: 221
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Messagebox autohide

Unread post by Timo »

I agree, sometimes, especially when it is used to output an error message it should not go away on its own. In my case a short informative message is shown and it can disappear again after 1-2 secs
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Messagebox autohide

Unread post by admin »

.
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Messagebox autohide

Unread post by toms »

Timo, you can use a timeout and hide the messagebox:

Code: Select all

function custMessageTimeout(msg, timeout) {
      nuMessage(msg);
      setTimeout(function() {
         $('#nuMessageDiv').hide();
        }, timeout);
}

if (nuFormType() == 'edit') {

 if (nuIsSaved()) {		
        custMessageTimeout(["Entry saved"],1500);
}
			
}	
Timo
Posts: 221
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: Messagebox autohide

Unread post by Timo »

Thanks mate, that works!
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Messagebox autohide

Unread post by admin »

.
Post Reply