Shawn Sandy wrote:

All,
I am having a hell of a time getting a simple required validation to work. Here are excerpts from my code/config files. Can anyone take a look and see if they see anything obvious. Thanks in advance!
Struts-config.xml (DynaForm extends DynaValidatorActionForm)
<form-bean name="companyLevelSecuritySettingsForm" dynamic="true" type="com.xxx.struts.forms.DynaForm">
<form-property name="securityLevel" type="java.lang.String"/>
<form-property name="id" type="java.lang.Long"/>
<form-property name="name" type="java.lang.String"/>
<form-property name="userCoDivId" type="java.lang.Long"/>
<form-property name="coDivName" type="java.lang.String"/> ...
</form-bean>
<action path="/user"
type="com.cgc.security.actions.UserAction"
name="userForm"
parameter="method"
scope="request"
validate="true"
input="/user.jsp">
<forward name="displayPage" path="/user.jsp"/>
<forward name="afterSave" path="/userList.do?method=displayPage"/>
<forward name="customize" path="/selectCoDiv.do?method=displayPage"/>
</action>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validations.xml"/>
</plug-in>
my jsp page includes these tags
<html:javascript formName="userForm" method="validateForm" dynamicJavascript="true" staticJavascript="true"/>
<html:form action="user.do" focus="name" onsubmit="return validateForm(this);">
validations.xml
<form-validation>
<formset>
<form name="/user">
<field property="name" depends="required">
<arg0 key="err.msg"/>
</field>
</form>
</formset>
</form-validation>




The big problem that I see is that your form is named companyLevelSecuritySettingsForm but you seem to be referring to it as userForm all over the place. Try fixing that. There may be other problems, but I didn't look to hard after seeing this first one.

Matt

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



Reply via email to