Jump to content

How to Highlight a Control that Fails Validation

Recommended Posts

I'm looking for best practices or guidance for the following scenario.


The front end is a page control with multiple pages.  The user completes the form and presses 'Save'.  The app takes the contents of the controls, populates an XML document, and sends the document to a server for validation and processing.


Let's say a validation error occurs.  One of the XML fields contained a negative number and only positive numbers are allowed.  How does the client know which page and control to highlight for a given validation?  I think there needs to be some association between the data entry controls and the XML fields, but I'm unsure what is the best way to build this.


Have you handled this situation before?  What algorithm or data structure did you use?







Share this post

Link to post
7 hours ago, StephenM said:

and sends the document to a server for validation

This sound like your starting point. You send something to someone (server). Then you should get a response (as you indicate above).

Does the response contain validation information? Then that information must be mapped to the control (perhaps via a field DataLink) and code written to indicate what is a miss.

If the response does not contain error information specific enough, then you option would be to show an error message unconnected to the "field" that is the culprit.


Show us the response from the server for better advice.

Share this post

Link to post

You have to link controls and XML fields 1:1, then just take invalid XML field, get its linked control, show it and display server's error text

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now