aspose file tools*
The moose likes Struts and the fly likes Struts2 Field validator is not working for mutiple textfield wich have same name. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Field validator is not working for mutiple textfield wich have same name." Watch "Struts2 Field validator is not working for mutiple textfield wich have same name." New topic
Author

Struts2 Field validator is not working for mutiple textfield wich have same name.

francis varkey
Ranch Hand

Joined: Sep 13, 2005
Posts: 169
Dear All,
I have mutiple textfield wich have same name in jsp. I am using stuts2 xml validation for validating it.

in jsp

<s:textfield name="startTime" id="startTime1" />
<s:textfield name="startTime" id="startTime2" />


in xml

<field name="startTime">
<field-validator type="fieldexpression" >
<param name="expression"><![CDATA[startTime.length > 0]]></param>
<message>StartTime is required!</message>
</field-validator>
</field>

but it is not checking the text fieds are empty or not. Just checking the length of the array.

Thanks
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

hi,

check for the word "require" in struts2 validation frame work. Thiswill give you idea.

Regards
Jatan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 Field validator is not working for mutiple textfield wich have same name.