Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cancel button problem

 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 597
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pravin check your private message, it is difficult to write script here because it contains html characters.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic