You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by RajasekharReddy <pa...@gmail.com> on 2011/09/02 09:45:41 UTC

Struts Validator Framework: client-side validation problem

I am trying to implement Client-Side Validations using struts 1.3

But server Side validations are working properly, but Client-Side
Validations are not working properly.

My code is as follows....




<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
<%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01
Transitional//EN&quot;&gt;
<html:html>
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>LoginPage</title>
  </head>
  
  <body>
  <center>
  <html:javascript formName="loginForm"/>
  
  	<html:form action="/login.do" onsubmit="return validateLoginForm(this)">>
		<table>
			<tr><td><bean:message key="uname"/> </td>
				<td><html:text property="uname"/></td>
				<td><html:errors property="uname"/> </td></tr>
				
			<tr><td><bean:message key="upass"/> </td>
				<td><html:password property="upass"/></td>
				<td><html:errors property="upass"/> </td></tr>
		</table>
		<html:submit value="Login" />
	  </html:form>
	  <br><em><strong>Click here to &nbsp; <html:link
href="SignUp.jsp">SignUp</html:link>  </strong></em><br>
  </center>
  </body>
</html:html>>


--
View this message in context: http://struts.1045723.n5.nabble.com/Struts-Validator-Framework-client-side-validation-problem-with-submitting-buttons-tp3481073p4761399.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts Validator Framework: client-side validation problem

Posted by Brian Thompson <el...@gmail.com>.
I'm not familiar with the <html:form> tag; does that auto-include the script
defining the validateForm() function?

If not, I'd suggest a missing <script> in the html as a likely culprit ...
at least, without any further info!

Brian



On Fri, Sep 2, 2011 at 5:47 AM, Dave Newton <da...@gmail.com> wrote:

> What happens? What do you expect to happen? What's your validation config?
> We need something beyond "it doesn't work".
>
> Dave
>  On Sep 2, 2011 3:47 AM, "RajasekharReddy" <pa...@gmail.com> wrote:
> > I am trying to implement Client-Side Validations using struts 1.3
> >
> > But server Side validations are working properly, but Client-Side
> > Validations are not working properly.
> >
> > My code is as follows....
> >
> >
> >
> >
> > <%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
> > <%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
> > &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01
> > Transitional//EN&quot;&gt;
> > <html:html>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> > <title>LoginPage</title>
> > </head>
> >
> > <body>
> > <center>
> > <html:javascript formName="loginForm"/>
> >
> > <html:form action="/login.do" onsubmit="return validateLoginForm(this)">>
> > <table>
> > <tr><td><bean:message key="uname"/> </td>
> > <td><html:text property="uname"/></td>
> > <td><html:errors property="uname"/> </td></tr>
> >
> > <tr><td><bean:message key="upass"/> </td>
> > <td><html:password property="upass"/></td>
> > <td><html:errors property="upass"/> </td></tr>
> > </table>
> > <html:submit value="Login" />
> > </html:form>
> > <br><em><strong>Click here to &nbsp; <html:link
> > href="SignUp.jsp">SignUp</html:link> </strong></em><br>
> > </center>
> > </body>
> > </html:html>>
> >
> >
> > --
> > View this message in context:
>
> http://struts.1045723.n5.nabble.com/Struts-Validator-Framework-client-side-validation-problem-with-submitting-buttons-tp3481073p4761399.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>

Re: Struts Validator Framework: client-side validation problem

Posted by Dave Newton <da...@gmail.com>.
What happens? What do you expect to happen? What's your validation config?
We need something beyond "it doesn't work".

Dave
 On Sep 2, 2011 3:47 AM, "RajasekharReddy" <pa...@gmail.com> wrote:
> I am trying to implement Client-Side Validations using struts 1.3
>
> But server Side validations are working properly, but Client-Side
> Validations are not working properly.
>
> My code is as follows....
>
>
>
>
> <%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
> <%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
> &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01
> Transitional//EN&quot;&gt;
> <html:html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>LoginPage</title>
> </head>
>
> <body>
> <center>
> <html:javascript formName="loginForm"/>
>
> <html:form action="/login.do" onsubmit="return validateLoginForm(this)">>
> <table>
> <tr><td><bean:message key="uname"/> </td>
> <td><html:text property="uname"/></td>
> <td><html:errors property="uname"/> </td></tr>
>
> <tr><td><bean:message key="upass"/> </td>
> <td><html:password property="upass"/></td>
> <td><html:errors property="upass"/> </td></tr>
> </table>
> <html:submit value="Login" />
> </html:form>
> <br><em><strong>Click here to &nbsp; <html:link
> href="SignUp.jsp">SignUp</html:link> </strong></em><br>
> </center>
> </body>
> </html:html>>
>
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/Struts-Validator-Framework-client-side-validation-problem-with-submitting-buttons-tp3481073p4761399.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>