diff options
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp index 8b16a19d8..5cab0954c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp @@ -33,21 +33,29 @@ <div id="searchBox"> <s:if test="%{#application['uiOptions'].appletFindEnabled}"> <script type="text/javascript"> - function generateMd5( file, defVal ) + function handleChecksum( form ) { - if ( file ) + if ( form.file.value ) { - var s = document.ChecksumApplet.generateMd5(file); + var s = document.ChecksumApplet.generateMd5( form.file.value ); // If there is a space, it's an error message, not a checksum if ( s.indexOf(" ") >= 0 ) { alert(s); - return ""; + return false; } else - return s; + { + form.file.disabled = true; + form.q.value = s; + } + } + else + { + form.file.disabled = true; + form.q.value = form.md5.value; } - return defVal; + return true; } </script> @@ -55,8 +63,7 @@ <span class="errorMessage">JavaScript is disabled: using the file browser will not work.</span> </noscript> - <s:form method="POST" action="checksumSearch" namespace="/" - onsubmit="this.q.value = generateMd5(this.file.value,this.md5.value); this.file.disabled = true;"> + <s:form method="POST" action="checksumSearch" namespace="/" onsubmit="return handleChecksum(this);"> <s:hidden name="q"/> <tr> <td class="tdLabel"><label for="checksumSearch_file" class="label">Search for:</label></td> |