wood burning stoves 2.0*
The moose likes Struts and the fly likes cancel button problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "cancel button problem" Watch "cancel button problem" New topic
Author

cancel button problem

Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

When i click on the cancel button it forwards the request.
i dont want the request to be forwarded
here is the code
<input type="image" src="images/bt_cancel.jpg" value="Cancel" 0nclick="return reset();">

inside script tag

function reset()
{
alert("h1");
document.getElementById("txtUserName_tblLogin_UserName").value="";
document.getElementById("txtPassword_tblLogin_Password").value="";
document.getElementById("txtUniversityID_tblLogin_UniversityID").value="Select";
return false;
}

i even tried using
if(this.isCancelled(request))
{
return mapping.findForward("failure");
}

then to its not working
can anybody please help me?


[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
SCJP1.5.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30377
    
150

Pravin,
this.isCancelled(request) is not working because you do not have a cancel button. You have an image that wants to serve as a cancel button. You have two choices here:
1) Use a real cancel button. A cancel button is a special type of input field.
2) Write your own logic to see whether it is a cancel. For example, you could add a special parameter.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

but my requirement is that i need to use image. can anyone suggest me something so that i can use it.or give me the code snippet to implement it. thank you
Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
Pravin check your private message, it is difficult to write script here because it contains html characters.


Sandeep
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30377
    
150

Originally posted by Rajesh Thakare:
Pravin check your private message, it is difficult to write script here because it contains html characters.

See this wiki page for how to escape HTML for posting in the forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cancel button problem