Hi George, Thanks for your response. I will see form-plug-in as per your suggestion. But I doubt whether I would be able to interact with Struts form using that.
Thanks, Bhavin On Nov 18, 7:15 pm, George <[EMAIL PROTECTED]> wrote: > I'll try to answer..... > I do not know what 'struts' is. but you have made major mistake in > your wishes. > > AJAX submit the data to the server and gets server's response. > It's your responsibility to collect data for AJAX call and parse out > server's response. > > So you correctly put return false to prevent submitting the form > through regular means by the browser but failed to collect data and > parse it out. > > To collect data from the "form plug-in" will help. > > As to parse it out you will have to do it yourself. Since first you > need to define the in which data structure you returning data from the > server. > I recommend JSON > > George. > > On Nov 18, 7:35 pm, Bhavin <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am using JQuery withStruts1.1. I am using following code when > > user > > clicks on Save button: > > > $('#save').click(function() { > > $.blockUI({ message: "<h1>Please wait...</h1>" }); > > > $.ajax({ > > url: '/saveData.do?dispatch=save', > > type:'post', > > cache: false, > > dataType:'xml', > > complete: function() { > > $.unblockUI(); > > } > > }); > > > Following is mystrutscode: > > > <body onload=""> > > <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> > > </body> > > > The problem here is it is submitting request twice because it is > > defined withstrutsform and with url (in ajax). How can I avoid > > duplicate request? > > > I tried return false in click event but then actionform is not > > populated from jsp fields. > > > Can anyone give working example of Jquery +Struts1 ? > > > Thanks, > > Bhavin