my dog learned polymorphism*
The moose likes Struts and the fly likes click on image to call javascript of pup up calendar, why the form submit? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "click on image to call javascript of pup up calendar, why the form submit?" Watch "click on image to call javascript of pup up calendar, why the form submit?" New topic
Author

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

michelle Wang
Ranch Hand

Joined: Jan 12, 2004
Posts: 65
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?


michelle Wang <br />SCJP 1.4
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
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.


http://www.goodercode.com
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: click on image to call javascript of pup up calendar, why the form submit?
 
Similar Threads
How to override the default behavior in select element
Selenium - Problem testing a date field.
How to send data from one window to another
Form submittal problem
can I force a call to onchange?