How to use struts2 submit tag as button without submitting the form?
If you are using s:submit
tag the rendered HTML
output is either input
or button
tag but the type is submit
except for the image
type. You can use the code to execute javascript onclick event that doesn't submit the form.
<s:submit type="button" onclick="return false;"/>
Have you tried preventDefault()
?
$("btnSave").click(function(e){ e.preventDefault(); //..rest of the code});