Tip

Multiple Input Validation Messages on One Web Page

Have you ever been irritated by receiving multiple error messages when trying to save a form on the Web? Wouldn't it be nice to have just one screen that told you ALL the fields you forgot to fill out? Well, here's one way to do that in R5.

When the user tries to save the document on the Web, it will show them one screen listing all the fields that they must fill out and asks them to go back and change them.


1. On your form properties, check the "Generate HTML for all fields" box.

2. Create a hidden, text, computed for display field called FailHeader at the top of your form with the following value formula:
"<html> <head><title>More Information Needed</title></head> <h2>The following required information was missing.</h2><body>"

3. Create a hidden, text, computed for display field called FailFooter at the top of your form with the following value formula:,
"<h2>Click your \browser's back arrow to return to your document.</h2> </body></html>"

4. Create a hidden, text, computed for display field called FailMsg at the top of your form with the following value formula:
DEFAULT FailMsg:=" ";FailMsg

5. Create a hidden, text, Editable field called FailurePage at the bottom of your form with the following input validation formula:
@If(FailMsg != " "; @Failure(FailHeader + FailMsg + FailFooter); @Success)

6. In each field that you want to validate, put the following input validation formula, changing the message and field name to match your field:
msg:="You must enter the First Name.";
@If(@IsDocBeingSaved & FirstName =""; @If(@BrowserInfo("BrowserType") = "Notes"; @Failure(msg); @Do(@SetField("FailMsg"; FailMsg + "" + msg); @Success)); @Success)

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.