Jump to content
Server Maintenance This Week. ×

Immediate Field Validation in FileMaker Pro 11 Advanced


This topic is 4063 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I recently upgraded from FileMaker Pro 7 Developer to FileMaker Pro 11 Advanced.  There are far more changes than I had originally expected, and so I'm carefully going through The Missing Manual book.  I note that the FileMaker Runtime is approx. 100 MB larger than before!   Anyway, I'd like to trap field entry mistakes at the time of the mistake rather than wait until the user clicks off all the fields.  That's when the regular validation occurs.  How can this be done with the new triggers?  For instance, if more than five numerals are entered into a zipcode field, I'd like to trap that immediately (beep) and put the cursor back into the zipcode field.  But that doesn't seem to work; part of the code is on p. 703 of the aforementioned book (essentially an If statement with Length(zipcode) test).  I've tried putting the trigger on OnObjectModify and OnObjectExit--no luck.  I'm sure that someone here has already figured this out.  Or is there a way to change FM so that all the field validations work at the time of tabbing out of the field rather than clicking off all the fields?

Link to comment
Share on other sites

I would use the on modify script trigger on the zip code field...

 

Script....

IF ( Length (ZipCode) > 5)

   Beep

   Go To Field ( ZipCode )

End IF

 

 

if It were ME i would just set the Zip Code field to be a calculation of Left ( Trim ( ZipCode ) ; 5 )

That will prevent the user from entering more than 5 chars in the zipcode field                                                                                                    

Link to comment
Share on other sites

KrisM:  That's the script I used, but it doesn't work!

 

MartieH:  Perfect.  I now have a script which commits the record upon exiting the field, and it performs the validation and goes right back to the field if it fails!

Link to comment
Share on other sites

This topic is 4063 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.