I have a form and once it gets submitted successfully , then after the roundtrip from the server I get a success message displayed on the same page.
I am using the following code:
<s:if test="%{#session.str==1}" >
<div onload="showSuccessToast();">
<button onclick="showSuccessToast();"></button>
</div>
</s:if>
Now when I return from the server (form submit successful) then the button is displayed and on its onClick event the showSuccessToast() is called but when I expect div to call this function on the onload event it has no effect.
Any idea how to achieve this.