You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by nagabrahmam <fo...@opensymphony.com> on 2006/03/22 12:36:39 UTC

userdefined clientside validations in struts

How to use our own JAVASCRIPT tags on client side in struts-framework?
ie., how can i use userdefined validations on client side in struts?
i hava created a jsp page like this but it was not working.
//*.jsp
---------------------------------------------------------------------------------------------------------

<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html:html>
	
	<head>
	<script language="JavaScript" src="script.js">
	</script>
	<title>Hello UserRegistration</title></head>
	<body>
		<bean:message key="errors.required" arg0="userName" >
		<html:form  action="hello.do"  onsubmit="return checkLogin(); ">
			<html:errors/>
			UserName<html:text property="userName" /><br>
			PassWord<html:password property="pwd1"/><br>
			Confirmp<html:password property="pwd2" /><br>
			Address <html:text property="address" /><br>
			<html:submit property="submit" /><br>
		</html:form>
	</body>
</html:html>
-------------------------------------------------------------------------------------------------------------------
//script.js
function checkLogin()
  {
   if(document.form1.userName.value == 0)
        {
         alert("please enter the UserName");
         document.form1.userName.focus();
        }
    else{
    	document.form1.submit();
    	}
    -------------------------------------------------------------------------
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=23163&messageID=44912#44912


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


Re: userdefined clientside validations in struts

Posted by Ted Husted <te...@gmail.com>.
This is a question best suited for the user list. Sadly, there is not
a forum setup for the user list right now, so you will have to
subscribe there and post in the old-fashioned way.

* http://struts.apache.org/mail.html

-Ted.

On 3/22/06, nagabrahmam <fo...@opensymphony.com> wrote:
> How to use our own JAVASCRIPT tags on client side in struts-framework?
> ie., how can i use userdefined validations on client side in struts?
> i hava created a jsp page like this but it was not working.
> //*.jsp
> ---------------------------------------------------------------------------------------------------------
>
> <%@ taglib uri="/tags/struts-html" prefix="html" %>
> <html:html>
>
>         <head>
>         <script language="JavaScript" src="script.js">
>         </script>
>         <title>Hello UserRegistration</title></head>
>         <body>
>                 <bean:message key="errors.required" arg0="userName" >
>                 <html:form  action="hello.do"  onsubmit="return checkLogin(); ">
>                         <html:errors/>
>                         UserName<html:text property="userName" /><br>
>                         PassWord<html:password property="pwd1"/><br>
>                         Confirmp<html:password property="pwd2" /><br>
>                         Address <html:text property="address" /><br>
>                         <html:submit property="submit" /><br>
>                 </html:form>
>         </body>
> </html:html>
> -------------------------------------------------------------------------------------------------------------------
> //script.js
> function checkLogin()
>   {
>    if(document.form1.userName.value == 0)
>         {
>          alert("please enter the UserName");
>          document.form1.userName.focus();
>         }
>     else{
>         document.form1.submit();
>         }
>     -------------------------------------------------------------------------
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=23163&messageID=44912#44912
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org

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