This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Validation for Indexed types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation for Indexed types" Watch "Validation for Indexed types" New topic
Author

Validation for Indexed types

Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Posts: 83
Hi,
I used

<formset>
<form name="LoginForm">
<field property="name" depends="required">
<arg0 key="Name Not Entered" resource="false"/>
</field>
.........................
these tags for validating name field. It is working fine.
But now I changed name to indexed one. ie many textboses are there.
name[0],name[1],................
ie the number of checkboxes are dynamic.
At this context how can I add validations to these dynamically generating text boxes.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
As far as I know, the validation framework does not have support for validating indexed properties.

- Brent
Jose Mon
Ranch Hand

Joined: Feb 13, 2007
Posts: 30
Can you suggest a convinient way or a commonly used way to meet this requirement. Do I need to write my own script for that?
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I do not use the client-side JavaScript validation. When I have had to validate indexed properties I just implemented the validation in the form's validate method.

- Brent
Jose Mon
Ranch Hand

Joined: Feb 13, 2007
Posts: 30
Any way to do client side validation for indexed textboxes?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
No. You can do it in server-side validation by specifying an indexedListProperty attribute with the <field> tag, but it is not supported in client-side validation. See the example I gave this thread.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation for Indexed types
 
Similar Threads
validwhen using indexedListProperty throwing NulPointerException
Indexed Properties Help!!!
Have any problem using validator
Automatic Population of Indexed Fields
Simple Question