Take a look at documentation for both tags. The property attribute is what you are looking. Pls read the documentation before posting.
On Sat, Apr 18, 2009 at 2:07 PM, abhishek reddy <abhishek.c1...@gmail.com> wrote: > thanks for the reply...it will just let me know if error messages are > present or not... > is it possible to retrieve error field name from it. > > > On Sat, Apr 18, 2009 at 7:23 AM, Suneel <sunee...@gmail.com> wrote: > >> You need to use these tags: >> <logic:messagesPresent> >> <html:message> >> >> >> On Sat, Apr 18, 2009 at 3:46 AM, abhishek reddy >> <abhishek.c1...@gmail.com> wrote: >> > 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 >> > >> >> >> >> -- >> Thanks >> Suneel >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > -- > Abhishek > -- Thanks Suneel --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org