I have a login page for my Nitrogen based web app. If user authentication fails I wf:flash a message to the user to let them know. However if the user continues to supply bad credentials these flash message keep building up. Is there a way to first clear the flashed messages before posting a new one?
+1
A:
the notify element here: http://github.com/zaphar/nitrogen-elements/tree/master/src/element_notify/
Is an expanded flash that allows you to have set a timed fade away for the flash message and a few other useful options. It might be what you are looking for.
Jeremy Wall
2010-01-07 00:09:39
+2
A:
I was able to remove the original flash message by calling:
wf:update(page__flash, [])
before updating with the new message (via wf:flash(Message)
). page__flash
is the id of the flash container div, and I just set it's content to be empty.
Jeremy Raymond
2010-01-07 00:47:07