Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE 5.5 SP1 posting twice on one Submit

Status
Not open for further replies.

spider737

Programmer
Feb 1, 2002
1
US
Has anyone noticed such an error previously? I've written a Java app that submits a form to a servlet (using Tomcat 3.3 and Apache 1.3.20--Java SDK 1.3.1) when a user wishes to save page values. I found that when the user presses the Save button on the JSP page, the servlet registers that a POST was made, then after some business logic executes, the servlet registers that a second POST was made. I'm checking on the page (using Javascript) that the button, even if pressed twice, will not submit the form twice, so I'm somewhat confused. Further, when I perform the same action using IE 5.00.2314, my servlet only registers that a single POST was made, as I expect. I've included the JSP below. I haven't seen any reference made to this issue on the Microsoft site or any other forums I've checked. Thanks in advance for any help.

<%@ page contentType=&quot;text/html;charset=WINDOWS-1252&quot;%>
<%@ page language=&quot;java&quot; %>
<%@ page import=&quot;model.uiBeans.*,java.util.*,functionality.*,com.Roles,java.lang.Integer, servlets.SuperServlet&quot;%>
<%@ taglib uri=&quot;tims&quot; prefix=&quot;tims&quot;%>
<%@ taglib uri=&quot;logic&quot; prefix=&quot;logic&quot; %>

<jsp:useBean id=&quot;functionality&quot; scope=&quot;session&quot; class=&quot;functionality.StudyFunctionality&quot; />
<jsp:useBean id=&quot;user&quot; class=&quot;model.baseBeans.BaseUser&quot; scope=&quot;session&quot;/>

<SCRIPT language=&quot;JavaScript1.1&quot;>
var submitted = false;

function processSubmit(actionDest) {
if (!submitted){
submitted = true;
StudyTestAnalytes.action=actionDest;
if (actionDest==&quot;/<%=SuperServlet.getApplicationName() %>/Dispatch/Study_Save&quot;) {
bSubmit=verify(StudyTestAnalytes,1);
if (bSubmit==true){StudyTestAnalytes.submit();}
}
else {
StudyTestAnalytes.submit();
}
}
}

function verify(f,verifyFrom){
var errors=&quot;&quot;;
var msg;

for (var i=0;i<f.length;i++){
var e = f.elements;
if (e.type==&quot;text&quot;){
if (e.name==&quot;TargetConcentration&quot;){
var x = parseFloat(e.value);
if (isNaN(x)){
errors+=&quot;- The Target Concentration field is not numeric. Enter a numeric Target Concentration.\n&quot;;
}
}
if (e.name==&quot;TargetUpper&quot;){
var x = parseFloat(e.value);
if (isNaN(x)){
errors+=&quot;- The Target Upper Concentration field is not numeric. Enter a numeric Target Upper Concentration.\n&quot;;
}
}
if (e.name==&quot;TargetLower&quot;){
var x = parseFloat(e.value);
if (isNaN(x)){
errors+=&quot;- The Target Lower Concentration field is not numeric. Enter a numeric Target Lower Concentration.\n&quot;;
}
}
}

}
if (!errors) return true;
if (verifyFrom==0) {
msg = &quot;_______________________________________________________________\n\n&quot;;
msg += &quot;The form was not submitted because of the following error(s).\n&quot;;
msg += &quot;Please correct these error(s) and re-submit.\n&quot;;
msg += &quot;_______________________________________________________________\n\n&quot;;
msg += errors;
alert(msg);
}
return false;
}

</SCRIPT>
<html>
<%
response.setHeader(&quot;Cache-Control&quot;,&quot;no-cache&quot;);
response.setHeader(&quot;Pragma&quot;,&quot;no-cache&quot;);
response.setDateHeader(&quot;Expires&quot;,0);
%>
<tims:security user=&quot;<%=user%>&quot; roles=&quot;<%= Roles.STUDY %>&quot;>

<head>
<tims:HeaderTag />
</head>
<BODY background=&quot;/<%=SuperServlet.getApplicationName() %>/images/bk_blueyell.gif&quot;>
<tims:pageTitle covHeader=&quot;Study Maintenance&quot; />

<form method=&quot;POST&quot; name=&quot;StudyTestAnalytes&quot; onSubmit=&quot;return verify(this,0);&quot;>

<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;140&quot; ></td>
<td width=&quot;556&quot; align=&quot;left&quot; valign=&quot;top&quot;> <img border=&quot;0&quot; src=&quot;/<%=SuperServlet.getApplicationName() %>/images/pixel.gif&quot; width=&quot;20&quot; height=&quot;20&quot;>
</td>
<td width=&quot;69&quot; ></td>
</tr>
<tr>
<tims:LinksSideBar />

<td width=&quot;100%&quot; align=&quot;left&quot; valign=&quot;top&quot;>

<table width=&quot;100%&quot; align=&quot;left&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot;>
<tr>
<td align=&quot;left&quot;>
<table border=0>
<tr>
<td align=&quot;right&quot;>Study:</td>
<td align=&quot;left&quot;><%= functionality.getStudyNumber() %></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align=&quot;left&quot;>
<table border=1>
<tr>
<td>
Study Test Name
</td>
<td>
Analyte Name
</td>
<td>
Log In
</td>
<td>
Units
</td>
<td>
Target<br>Concentration
</td>
<td>
Target<br>Lower
</td>
<td>
Target<br>Upper
</td>
<td>
Target<br>Comments
</td>
</tr>
<% Vector studyTestAnalytes = functionality.getStudyTestAnalytes();
int i=0;
String storedStudyTestName=&quot;&quot;;
for (Enumeration e = studyTestAnalytes.elements() ; e.hasMoreElements() ;) {
UiStudyTestAnalyteData testAnalyte = (UiStudyTestAnalyteData)e.nextElement(); %>
<tr>
<% if (i==0){ %>
<td><INPUT type=&quot;Text&quot; name=&quot;StudyTestName&quot; value=&quot;<%= testAnalyte.getStudyTestName() %>&quot; readonly></INPUT></td>
<% }else if ((i>0) && (!testAnalyte.getStudyTestName().equals(storedStudyTestName))){ %>
<td><INPUT type=&quot;Text&quot; name=&quot;StudyTestName&quot; value=&quot;<%= testAnalyte.getStudyTestName() %>&quot; readonly></INPUT></td>
<% }else if ((i>0) && (testAnalyte.getStudyTestName().equals(storedStudyTestName))){ %>
<td><INPUT type=&quot;hidden&quot; name=&quot;StudyTestName&quot; value=&quot;<%= testAnalyte.getStudyTestName() %>&quot;></INPUT></td>
<% }storedStudyTestName=testAnalyte.getStudyTestName();
i=i+1; %>

<td><INPUT type=&quot;Text&quot; name=&quot;AnalyteName&quot; value=&quot;<%= testAnalyte.getAnalyteName() %>&quot; readonly></INPUT></td>
<td>
<tims:buildList collection=&quot;<%= functionality.getAutoLoginValues() %>&quot; listName=&quot;LogIn&quot; listSize=&quot;0&quot; onChange=&quot;&quot; type=&quot;model.uiBeans.UiLookup&quot; value=&quot;getDescription&quot; display=&quot;getDescription&quot; selectedValue=&quot;<%= testAnalyte.getLogIn() %>&quot;></tims:buildList>
<td>
<tims:buildList collection=&quot;<%= functionality.getAllUnits() %>&quot; listName=&quot;Unit&quot; listSize=&quot;0&quot; onChange=&quot;&quot; type=&quot;model.uiBeans.UiLookup&quot; value=&quot;getDescription&quot; display=&quot;getDescription&quot; selectedValue=&quot;<%= testAnalyte.getUnits() %>&quot; initialValue=&quot;0&quot; initialDisplay=&quot;&quot;></tims:buildList>
</td>
<td><INPUT type=text name=&quot;TargetConcentration&quot; size=5 value= <%=testAnalyte.getTargetConcentration() %> onChange=&quot;&quot;></INPUT></td>
<td><INPUT type=text name=&quot;TargetLower&quot; size=5 value=<%=testAnalyte.getTargetLower() %> onChange=&quot;&quot;></INPUT></td>
<td><INPUT type=text name=&quot;TargetUpper&quot; size=5 value=<%=testAnalyte.getTargetUpper() %> onChange=&quot;&quot;></INPUT></td>
<td><INPUT type=text name=&quot;TargetComments&quot; size=50 value=&quot;<%=testAnalyte.getTargetComments() %>&quot; onChange=&quot;&quot;></INPUT></td>
</tr>
<% } %>
</table>
</td>
</tr>
</td>
</table>

<!-- fourth table cell is a spacer column - 25 pixels wide - between content and right side of screen-->
<td width=&quot;69&quot; rowspan=&quot;2&quot; ><img src=&quot;/<%=SuperServlet.getApplicationName() %>/images/pixel.gif&quot; width=&quot;1&quot; height=&quot;1&quot;></td>
</tr>
<tr>
<td width=&quot;140&quot; ></td>
<td width=&quot;556&quot; align=&quot;left&quot; valign=&quot;top&quot;> <!-- text links -->
</td>
</tr>
<tr>
<td></td>
<td align=&quot;center&quot;><input type=&quot;submit&quot; value=&quot;Save Study&quot; onClick=&quot;processSubmit('/<%=SuperServlet.getApplicationName() %>/Dispatch/Study_Save');&quot;></input></td>
</tr>
<tr>
<td> </td>
<% String defaultErrorString = &quot;&quot;;
if (session.getAttribute(&quot;Error&quot;)!=null && !(session.getAttribute(&quot;Error&quot;).equals(defaultErrorString))){
Exception error=(Exception)session.getAttribute(&quot;Error&quot;);
String exName = error.getClass().getName();
if (exName.toUpperCase().equals(&quot;FUNCTIONALITY.STUDYTESTNOANALYTESEXCEPTION&quot;)) { %>
<td><FONT color=&quot;#FF0000&quot;><%= error.getMessage() %></FONT></td>
<% }
} %>
<tr>
</table>

<!-- Close the web form to submit the data -->
</form>

</BODY>
</tims:security>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top