Sample Script

Dim emailAddress
Dim userName
' The form has 2 fields Field1 and Field2. Field1 type is string. 
' Field2 type is StringList.
' save UserName and EmailAddress for later reference

function Initialize(UserName, EmailAddress)
   userName = Name
   emailAddress = Email
end function

function InitializeField(fieldName, fieldValue)
   'custom initialization for user with a name equal "Name1"
   if fieldName = "Field2" and userName = "Name1" then
      InitializeField = "Selection1, Selection2, Selection3"
      exit function
   end if
   'custom initialization for user with aname equal "Name2"
   if fieldName = "Field2" and userName = "Name2" then
      InitializeField = "Selection3, Selection4, Selection5"
      exit function
   end if
   'do nothing
   InitializeField = ""
end function

function ValidateField(fieldName, fieldValue)
   'custom validation 
   ifemailAddress = "useraddress@nsius.com" and fieldName = "Field1" then
   if (fieldValue != "TestValue")
      'Displays"Invalid Value" on scanner Panel
      ValidateField = "Invalid Value" 
      exit function
   endif 
   'do Nothing
   ValidateField = ""
end function