Hmm, I've never actually used the html:javascript tag, so I'm not sure what its intended purpose is, or how it works... seems like the docs is talking about validation, so yeah, maybe it's not applicable... although, one thing I notice here... let's assume it DOES work just like a plain old <script> tag does... om that case, the contents of your .js file might cause a problem because it's not Javascript really, it's HTML... If you make source.js just the following:

  function showme() {
  alert("pls try");
  return false;
  }

...then it MAY work... if it still doesn't, I'd not use the html:javascript tag at all, just use a plain <script> tag... looks to me like your just trying to import the .js file, and I can't think of a good reason to use a Struts tag for something as basic as that anyway.

Frank

P.S. - I'd bet it's not a problem, but it's unusual to see the taglib declarations within the markup of the page... they are usually prior to the opening <html> tag... again, may not be a problem the way you have it, but I'd move them up, just to be safe.


john lee wrote:
Frank/Musachy,
tks for your help, after i change OnSubmit to lower case, it works. But when i try to test html:javascript, give me more erros, is html:javascript only used for validor only, and can not used as regular javascript for include? tks in advance john The error message: Error: missing } in XML expression
Source File: /source.js
Line: 4, Column: 20
Source Code:
    alert("pls try");
source.js <head>
  <script language="javascript">
  function showme() {
  alert("pls try");
  return false;
  }
  </script>
  </head>
Search.jsp <head>
  <html:javascript src="source.js" />
  </head>
  <%@ taglib uri="/html" prefix="html" %>
  <%@ taglib uri="/bean" prefix="bean" %>
  <html:form action="/partsearchinput" onsubmit="return showme()">
  <table>
  <tr><td><bean:message key="label.search.part"/>:</td>
  <td><html:text property="part"/></td></tr>
  <tr><td><html:submit/></td></tr>
  </table>
  </html:form>

---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to