File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript confirm() is not working properly with struts dojo anchor tag

 
lydia edward
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a requirement like I need to call javascript confirm box and based on the user's decision i have to call href.
So i am using <sx:a> tag for hyperlink.

<%@taglib uri="/struts-dojo-tags" prefix="sx" %>

<td align="center"><sx:a id="url2" href="%{deleteUrlTag}" executeScripts="true" onclick="return confirm('Do you really want to delete this User');" targets="six" separateScripts="false">Delete</sx:a></td>

Here I am facing following issue:
When user clicks on "No", then also it is calling the href and deleting the user.
Ideally it should go for href in case of when user selects "YES".

I also tried with this solution but that didn't work.

<td align="center"><sx:a id="url2" href="%{deleteUrlTag}" executeScripts="true" onclick="return confirm('Do you really want to delete this User');return false;" targets="six" separateScripts="false">Delete</sx:a></td>


Can you please suggest me the solution for this.

Thanks
Satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic