File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

click on image to call javascript of pup up calendar, why the form submit?

 
michelle Wang
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a image of calendar on a JSP page, and the page is in a struts form.
When i click on the calendar, it should display a calendar to choose DOB, but now when the calendar pop up, the form also been submited, wondering how to prevent this?
 
Kerry Wilson
Ranch Hand
Posts: 254
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your image is being displayed as an input field (i.e. <input type="image"> , then it will submit the form when it is clicked. Otherwise you should be using the javascript onClick or html's href for the anchor tag around the image.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic