Hi,
I am using JQuery with
Struts 1.1. I am using following code when user
clicks on Save button:
$('#save').click(function() {
$.blockUI({ message: "Please wait..." });
$.ajax({
url: '/saveData.do?dispatch=save',
type:'post',
cache: false,
dataType:'xml',
complete: function() {
$.unblockUI();
}
});
In my struts code,
<html:form action="/saveTemplate.htm?dispatch=save" method="POST">
<div id="firstchildcontainer">
Name: <html:text property="templateName"/>
Description: <html:textarea property="description" rows="8"
cols="10"/>
<html:submit styleId="save"><bean:message key="button.save"/></
html:submit>
<html:cancel styleId="cancel"><bean:message key="button.cancel"/></
html:cancel>
</div>
</html:form>
The problem here is it is submitting request twice because it is
defined with struts form and with url (in ajax). How can I avoid
duplicate request?
Thanks,
Bhavin