Originally posted by Vipin Sahu:
is there any way to focus the cursor on the error field in struts.
Yes, with a combination of Javascript and the <logic:messagesPresent>. Just specify an onload event in the <body> tag that references a JavaScript function. Then in that function, code something like this:
If fields A, B, and C all have errors, focus will be on FieldC since it's the last in the list. You therefore might want to put the conditions in the reverse order of how they appear on the screen. That way the top field on the screen that has an error will get the focus.
Originally posted by Vipin Sahu:
how can we display only one error at a time.
You do this using the property attribute. If you want a separate field that only shows errors for fieldA, specify the following: