• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

cancel button problem

 
Ranch Hand
Posts: 152
Eclipse IDE Chrome 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?
 
author & internet detective
Posts: 39435
768
Eclipse IDE VI Editor Java
  • 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
Eclipse IDE Chrome 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
 
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
Posts: 39435
768
Eclipse IDE VI Editor Java
  • 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.
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!