Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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: 39997
807
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: 39997
807
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.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic