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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 165
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: 296

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.
 
Similar Threads
OR mapping mutiple update statement !!!
mutiple record validate
mutiple tabels join usage
validation problem for cost : struts2
how to handle mutiple buttons