You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by john lee <sh...@yahoo.com> on 2007/04/14 20:25:40 UTC

struts/javascript challenge

I am new to struts, how can I use client javascipt inside html:form ?
   
  when i run my test.jsp with html:form and javascript, and get following error, what is that mean ?
   
  tks everyone's help in advance.
   
  john

org.apache.jasper.JasperException:

Attribute OnSubmit invalid for tag form according to TLD
   
   
  <head>
  <script language="javascript">
  function showme() {
  alert("what is wrong");
  return false;
  }
  </script>
  </head>
  <%@ taglib uri="/html" prefix="html" %>
  <%@ taglib uri="/bean" prefix="bean" %>
   
  <html:form action="/partsearchinput" OnSubmit="return showme()">
  <table>
  <tr><td><br></td></tr>
  <tr>
  <td><bean:message key="label.search.part"/>:</td>
  <td><html:text property="part"/>
  <html:errors 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.

Re: struts/javascript challenge

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
onsubmit needs to be all lower-case, you have it written OnSubmit.  Any 
time you get an exception saying an attribute is invalid for a tag, the 
TLD is the first thing you should look at, make sure the attribute is 
specified for the tag and that you wrote it exactly as it appears there, 
case and all.

Frank

john lee wrote:
> I am new to struts, how can I use client javascipt inside html:form ?
>    
>   when i run my test.jsp with html:form and javascript, and get following error, what is that mean ?
>    
>   tks everyone's help in advance.
>    
>   john
> 
> org.apache.jasper.JasperException:
> 
> Attribute OnSubmit invalid for tag form according to TLD
>    
>    
>   <head>
>   <script language="javascript">
>   function showme() {
>   alert("what is wrong");
>   return false;
>   }
>   </script>
>   </head>
>   <%@ taglib uri="/html" prefix="html" %>
>   <%@ taglib uri="/bean" prefix="bean" %>
>    
>   <html:form action="/partsearchinput" OnSubmit="return showme()">
>   <table>
>   <tr><td><br></td></tr>
>   <tr>
>   <td><bean:message key="label.search.part"/>:</td>
>   <td><html:text property="part"/>
>   <html:errors 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: fzammetti@hotmail.com
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts/javascript challenge

Posted by Musachy Barroso <mu...@gmail.com>.
The attributes are case sensitive, so you have to used them as they are
specified in the docs, try "onsubmit" instead.

regards
musachy

On 4/14/07, john lee <sh...@yahoo.com> wrote:
>
> I am new to struts, how can I use client javascipt inside html:form ?
>
>   when i run my test.jsp with html:form and javascript, and get following
> error, what is that mean ?
>
>   tks everyone's help in advance.
>
>   john
>
> org.apache.jasper.JasperException:
>
> Attribute OnSubmit invalid for tag form according to TLD
>
>
>   <head>
>   <script language="javascript">
>   function showme() {
>   alert("what is wrong");
>   return false;
>   }
>   </script>
>   </head>
>   <%@ taglib uri="/html" prefix="html" %>
>   <%@ taglib uri="/bean" prefix="bean" %>
>
>   <html:form action="/partsearchinput" OnSubmit="return showme()">
>   <table>
>   <tr><td><br></td></tr>
>   <tr>
>   <td><bean:message key="label.search.part"/>:</td>
>   <td><html:text property="part"/>
>   <html:errors 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.




-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd