This content has been marked as final.
Show 3 replies
-
1. Re: s:button vs. onclick
christian.bauer Feb 22, 2008 5:12 PM (in response to dahm)Use s:link and style it as a button with CSS. Many buttons on this website are s:link.
-
2. Re: s:button vs. onclick
keithnaas Feb 22, 2008 5:37 PM (in response to dahm)I couldn't agree more with Christian. On apps I've worked on, we avoid buttons at all cost since links work so well (and links are easier to style since IE doesn't let you control much of the look of a button).
-
3. Re: s:button vs. onclick
satrapu May 12, 2010 10:05 AM (in response to dahm)I know this is an old post, but I encountered the same problem.
I just wanted a simple javascript confirmation box - if the user clicks OK, perform the action, otherwise do nothing.Here is my solution for the s:button:
<s:button value="Cancel" action=#{myBean.doCancel} onclick="if(!confirm('Are you sure ... ?')) return false;"/>
You do not need to add if(!confirm(...)){return false;}else{return true;}.