Field Validation with MatchText

dcpbarrington dpierce at xpertassist.com
Thu Jan 10 17:54:39 EST 2008


My data validation is failing in a strange way.  If I enter the correct
value, the validation comes back TRUE and everything is ok, but if I put in
a BAD value, the data validation returns FALSE and displays the correct
error message.  WORKS AS EXPECTED, BUT  The application returns the user to
the data entery field with the text selected.  I then enter the data in the
correct format and from then on the validation always returns FALSE.  I must
be using something incorrectly or there is a bug.  Here is what I have in RR
V2.8.1

I have a Postal Code data entry field that I have added the following
validation:

on closeField
  put me into tPostalCode
  if CheckPostalCode(tPostalCode)= false then
    answer error "Format of postal code is incorrect: ##### or #####-####"
    select the text of me
    exit closeField
    end if
end closeField

CheckPostalCode is a Stack Script

--|
function CheckPostalCode tCodeToCheck 
put "^(\d5(( |-)\d4)?)"  into tRegExp
answer information "Code = " &tCodeToCheck && " Exp = " &tRegExp
return matchText(tCodeToCheck, tRegExp) 
end CheckPostalCode 

I have added a debug statement and the data the I have entered is being sent
to the matchText function and the regular express is as I defined.  Once the
error starts I'm unable to leave the data entry field without the error
condition and must close the card to get out of the loop.  Any ideas would
be appreciated.

dcp
-- 
View this message in context: http://www.nabble.com/Field-Validation-with-MatchText-tp14745808p14745808.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list