cancel
Showing results for 
Search instead for 
Did you mean: 

Form validation

Former Member
0 Kudos

Hi all,

Our client uses a form with many fields, they are placed in several tabs. When filling in the form, there is no sequence with regard to the tabs (or the form fields): the user should be able to fill in the fields in any order, switching from tab to tab in any possible way.

The requirements for a form for our client are these:

When all required fields on a tab have been specified, an green icon should appear on the tab strip next to the caption to indicate input is valid.

If the input is incorrect, a red icoun should appear next to the text.

If input is incomplete (initial state), no icon should appear on the tab strip.

Furthermore, (question2) the first field that does not pass validation should receive focus.

And (question3) when a field does not pass validation, and it is at the bottom of the page, not visible for the user because of a vertical scrollbar, the form should scroll to that field.

Finally, are there any good articles on form validation and creating error messages?

Thanks in advance,

Roelof

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Web Dynpro does not support custom coding with JavaScript.

For Question 1: Only palce to call your validation routines in your case is "OnSelect" of "TabStrip". To change text/image of Caption, Bind text/Image to context and change in context as required.

For Question 2. if u use <i>IWDMessageManager.reportInvalidContextAttributeException()</i> to report errors, that field will be highlighted. If this is not exactly what you want, use <i>IWDView.requestFocus()</i>

For Question 3: Just place UI element "MessageArea" in your view. You don't need to do anything. All Messages will be displayed automatically there. If you don't have any "MessageArea" element in your view(Which is default case), Messages will be printed at the bottom of page.

eddy_declercq
Active Contributor
0 Kudos