hi all,

how to highlight error fields in struts html form when validation fails i.e i
want my cursor focus on the error field when validation fails. ?

Note: Validations are performed on the server side (validate() method of
respective form bean)

this is what iam doing...


ActionMessages errors = new ActionMessages();

        if (form.getName() == null || form.getName().trim().length() == 0) {
            errors.add("name", new ActionMessage("name.error.required"));
            check=true;
        }
        else
        if (form.getId() == null || form.getId().trim().length() == 0) {
            errors.add("id", new ActionMessage("id.error.required"));

        }

Note: where "name" and "id" refers to struts html field names?
do i need to make any addtional changes to make it happen?

Please let me know, is it possible to retrieve the error field name on the
client side when validation fails....

-- 
Abhishek

Reply via email to