Strut2 validation - Select tags

231 Views Asked by At

I am having some problems Validating a select tag in one of my forms.

The for code for select is as follows;

 <s:select list="assessmentTypes" headerKey="0" headerValue=" -- Select One --"
  listKey="id" value="name" listValue="name" key="course.assessmenttype"
  name="assessmenttype.id"/>

and validation is as follows;

<field name="assessmenttype.id">
    <field-validator type="requiredstring">
        <message key="errors.required"/>
    </field-validator>
</field>

any help would be appreciated.

1

There are 1 best solutions below

0
On

use the below code for in ur jsp

s:select list="assessmentTypes" headerKey="" headerValue=" -- Select One --" listKey="id" value="name" listValue="name" key="course.assessmenttype" name="assessmenttype.id"/>

Cheers Shakil