I am new to programming, and currently I work as a junior programmer. I am currently having some problems validating select tags in one of my forms. What I'm actually trying to do is make sure that one item is selected before the user submits the form.
In the form I am:
<s:select list="assessmentTypes" headerKey="0" headerValue=" -- Select One --" listKey="id" value="name" listValue="name" key="course.assessmenttype" name="assessmenttype.id"/>
I have some validation information but am not sure how to do this for a select list.
I tried using a regular check with strings, but I don't think it is necessary in this case. eg,
<field name="course.assessmenttype"> <field-validator type="requiredstring"> <message>Please Select a value</message> </field-validator> </field>
All help would be appreciated, thanks in advance.
source share