You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jonathan M Z <wo...@yahoo.com> on 2005/02/16 19:39:11 UTC
weird problem generating javascript validation from xml
hi folks, I am having some problem with javascript
validation code generation.
I have the following code in my jsp(only showing the
relevant ones):
<html:form onsubmit="return validateLogonForm(this)"
action="/logon" method="post">
<script language="javascript">
<html:javascript
formName="logonForm"></html:javascript>
</script>
I have the following in validation.xml
<form-validation>
<!-- ========== Default Language Form Definitions
===================== -->
<formset>
<form name="logonForm">
<field property="userName"
depends="minlength,maxlength">
<arg0 key="prompt.username"/>
<arg1 key="${var:minlength}"
name="minlength"
resource="false"/>
<arg2 key="${var:maxlength}"
name="maxlength"
resource="false"/>
<var>
<var-name>maxlength</var-name>
<var-value>16</var-value>
</var>
<var>
<var-name>minlength</var-name>
<var-value>3</var-value>
</var>
</field>
...
I have the following in my struts configuration file:
<plug-in
className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
<form-beans>
<form-bean name="logonForm"
type="com.xxx.software.xxx.security.LogonForm"/>
</form-beans>
<action-mappings>
<action path="/logon" name ="logonForm"
type="com.xxx.software.xxx.security.LogonAction">
</action>
</action-mappings>
The problem is that the default javascription
functions from validation-rule.xml are generated(eg.
validateByte, validateFloat) but not
validateLogonForm().
what's wrong here?
__________________________________
Do you Yahoo!?
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: weird problem generating javascript validation from xml
Posted by Mr Maillist <dw...@gmail.com>.
try <html:javascript formName="logonForm" dynamicJavascript="true">
On Wed, 16 Feb 2005 10:39:11 -0800 (PST), Jonathan M Z
<wo...@yahoo.com> wrote:
> hi folks, I am having some problem with javascript
> validation code generation.
>
> I have the following code in my jsp(only showing the
> relevant ones):
>
> <html:form onsubmit="return validateLogonForm(this)"
> action="/logon" method="post">
> <script language="javascript">
> <html:javascript
> formName="logonForm"></html:javascript>
> </script>
>
> I have the following in validation.xml
> <form-validation>
>
> <!-- ========== Default Language Form Definitions
> ===================== -->
> <formset>
>
> <form name="logonForm">
>
> <field property="userName"
> depends="minlength,maxlength">
> <arg0 key="prompt.username"/>
> <arg1 key="${var:minlength}"
> name="minlength"
> resource="false"/>
> <arg2 key="${var:maxlength}"
> name="maxlength"
> resource="false"/>
> <var>
> <var-name>maxlength</var-name>
> <var-value>16</var-value>
> </var>
> <var>
> <var-name>minlength</var-name>
> <var-value>3</var-value>
> </var>
> </field>
> ...
>
> I have the following in my struts configuration file:
> <plug-in
> className="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
> value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> </plug-in>
> <form-beans>
> <form-bean name="logonForm"
>
> type="com.xxx.software.xxx.security.LogonForm"/>
>
> </form-beans>
>
> <action-mappings>
> <action path="/logon" name ="logonForm"
> type="com.xxx.software.xxx.security.LogonAction">
> </action>
> </action-mappings>
>
> The problem is that the default javascription
> functions from validation-rule.xml are generated(eg.
> validateByte, validateFloat) but not
> validateLogonForm().
> what's wrong here?
>
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page – Try My Yahoo!
> http://my.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org