DataEase and Ffenics – Performing Dynamic Validations

This script demonstrates how the PostEdit Event can be used to perform dynamic validation, by automatically testing values as they are typed in by the user. This example script rejects any input which contains spaces in the value.

Note that if you want to accept their typing you say return(1) ( or 0 would do ) but if you want to reject their input, re-instating the original contents type return(2).

In a fields script choose the PostEdit event and put…

if textpos( string , ” ” ) > 0 then
message “Please re-enter without using spaces” window .
return(2) . — failure of input to satisfy
else
return(1) . — acceptable input
end

This script uses the passed parameter for the postedit event which is “string” .

This contains the incoming value entered by the user, whereas the Value property of the field still
contains the original contents.

Provided by Simon Irwin    (DataEase Consultant)

Comments are closed.