Yes, I think so. I just tried again with a small function and a test form. Having a html:submit and also giving form.submit() from a method works fine in firefox, meaning that it doesn't submit the form twice, but in IE, the form does get submitted twice occasionally. I think the reason could be that, html:submit submits the form anyways and you are also calling form.submit explicitly. Hence it is getting submitted twice occasionally.
-----Original Message----- From: Krishna, Hari (FTT-CInternet) [mailto:[EMAIL PROTECTED] Sent: Thursday, April 26, 2007 11:25 AM To: Struts Users Mailing List Subject: RE: Form submission But is this html:submit is the culprit here?? Do I really need to replace this html:submit Regards, I.HariKrishna | Software Engineer | Franklin Templeton International Services (India) Pvt. Ltd. | Franklin Templeton Centre,1st Floor, No.7,Third Cross Street, Kasturba Nagar, Adyar, Chennai 600020 | Tel: +91 44 24407000 | Extn: 17123 | Fax: +91 44 24453661 | Mobile: +91 9884528587 | www.franklintempleton.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 26, 2007 11:24 AM To: user@struts.apache.org Subject: RE: Form submission You can try replacing the html:submit with html:button and call your populateAndSubmit() method from the button. -Pushkar. -----Original Message----- From: Krishna, Hari (FTT-CInternet) [mailto:[EMAIL PROTECTED] Sent: Thursday, April 26, 2007 11:14 AM To: Struts Users Mailing List Cc: Amara, Balanjaneyulu; [EMAIL PROTECTED] Subject: Form submission Hi all, I am facing a peculiar problem with form submission. In my jsp I am using html:submit tag to create a submit button and calling a javascript method populateAndSubmit() which will do a form submission with document.ChallengeQuestionForm.submit(); Now the issue is this form is getting submitted two times occasionally. I am really surprised to see this random behaviour and please let me whether replacing html:submit with input type="submit" will solve the problem? <html:submit onclick="populateAndSubmit()" tabindex="37" ></html:submit> function populateAndSubmit() { if(myId[1]!=-1) { //This check ensures that challenge questions are selected for(i=1;i<=4;i++) { index=myId[i]; if(document.getElementById("check"+index).value!=" ") questionelementId="check"+index;//system question else questionelementId="user"+index;//userquestion anselementId="text"+index; if(i==1) { document.ChallengeQuestionForm.challengeQuestion1.value =document.getElementById(questionelementId).value; document.ChallengeQuestionForm.challengeAnswer1.value =document.getElementById(anselementId).value; if(index==1) {//if the index is 1 , this is the date of birth question, so set the answer from the mm/dd/yyyy fields document.ChallengeQuestionForm.challengeAnswer1 .value = document.ChallengeQuestionForm.month.value + "/"+document.ChallengeQuestionForm.date.value+"/" +document.ChallengeQuestionForm.year.value; } } if(i==2) { document.ChallengeQuestionForm.challengeQuestion2.value =document.getElementById(questionelementId).value; document.ChallengeQuestionForm.challengeAnswer2.value =document.getElementById(anselementId).value; } if(i==3) { document.ChallengeQuestionForm.challengeQuestion3.value =document.getElementById(questionelementId).value; document.ChallengeQuestionForm.challengeAnswer3.value =document.getElementById(anselementId).value; } if(i==4) { document.ChallengeQuestionForm.challengeQuestion4.value =document.getElementById(questionelementId).value; document.ChallengeQuestionForm.challengeAnswer4.value =document.getElementById(anselementId).value; } } } document.ChallengeQuestionForm.submit(); } Regards, I.HariKrishna | Software Engineer | Franklin Templeton International Services (India) Pvt. Ltd. | Franklin Templeton Centre,1st Floor, No.7,Third Cross Street, Kasturba Nagar, Adyar, Chennai 600020 | Tel: +91 44 24407000 | Extn: 17123 | Fax: +91 44 24453661 | Mobile: +91 9884528587 | www.franklintempleton.com Notice: All email and instant messages (including attachments) sent to or from Franklin Templeton Investments (FTI) personnel may be retained, monitored and/or reviewed by FTI and its agents, or authorized law enforcement personnel, without further notice or consent. Notice: All email and instant messages (including attachments) sent to or from Franklin Templeton Investments (FTI) personnel may be retained, monitored and/or reviewed by FTI and its agents, or authorized law enforcement personnel, without further notice or consent. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]