FreeForm Automatic data validation and calculations.

FreeForm Automatically Calculated

Create two controls are used to demonstrate automatic calculation:

 

 

Calculated automatically added into the Runtime Design

Character formula

 

ToUpper

 

Then mouse over the brackets () in the middle

 

Press the keyboard Ctrl key, the control will automatically appear on the current list, select FieldA

Click Add, and click OK

 

In FieldA input abcd, then automatically calculated into the Runtime Design Test

Click "Test Calculation"

You can see the effect:

 

The method is similar to other operations.

 

Time formula

 

Add to FieldA formula ShortDateString:

 

 

 Now

 

Click "Test Calculation"

You can see the effect:

Digital Formula

 

Remember the formula for calculating area of ​​a circle it? Is πr ² (pi * radius squared)

 

Add the formula:

We now have to try it, enter the radius of 5

 

Click "Test Calculation"

You can see the effect:

 

 

FreeForm provides two kinds of data validations: general validation and custom validation, the former is simpler to support general validation, custom validation can write complex combinations can be used for more complex business systems.

FreeForm General Validation

Add into the Runtime Design

 

Demo

For example, we should require Min Age minimum age must be equal to 1, the maximum age must be less than or equal to 150, then such a definition:

 

If we input the wrong value, click on "Test Validations" or "Design Check" in the "Check".

Error message will appear automatically.

Authentication method supported by many, does not describe, including the almost universal Regex Expression.

 

FreeForm Dynamic Custom Validation

General validation has limitations, it is only a statement a statement of entry, some of the complex validation difficult to achieve, so we developed a dynamic customer custom validation.

 

Add into the Runtime Design custom validation:

 

 

Demo

For example, we provide for a Male or Female sex selection, when, real Age must be greater than Min Age, at the same time, must be less than Max Age, if Male and Female in the non-election , not verified.

 

We can define :

 

( [Male] == 'True' ||  [Female] == 'True') ?

( [Male] == 'True' ||  [Female] == 'True') && ( [RealAge]  >= [MinAge]) && ( [RealAge] <= [MaxAge] ) : true

 

 

Do not forget the keyboard Ctrl key, it will automatically appear on the current list of controls is very convenient. Effect is as follows:

 

Test results

When a selected gender, age greater than 150

An error:

And shows the red box:

 

When gender is not election time, even greater than 150 will no error message.

 

This example, we put Demo menu, you can test.

 

by clicking the "Test Validations" or "Design Check" in the "Check".

 

 

 

Demonstrate(ver2011)

http://crmwin.com/FreeForm2011TestPage.html

 

你可能感兴趣的:(validation)