dbTalk Databases Forums  

How do I validate these fields

comp.databases.filemaker comp.databases.filemaker


Discuss How do I validate these fields in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
davepres
 
Posts: n/a

Default How do I validate these fields - 10-03-2009 , 08:41 AM






Hi there

FMPro10adv. Vista

I have 2 fields I would like to validate.

1) This is a text field and we input numbers but they must be 4 digits
eg 0412 or 1014. I want a message or warning if anything other than 4
digits is entered

2) I have a date field and in the validate section I can only find
"validate for 4 digit year". I just want to make sure there is a valid
date eg 12/11/2009 or 05/10/14. (Australia uses dd/mm/yy or dd/mm/
yyyy)

Thanks in advance

David

Reply With Quote
  #2  
Old   
Jens Teich
 
Posts: n/a

Default Re: How do I validate these fields - 10-03-2009 , 09:35 AM






davepres <davidpreswick (AT) gmail (DOT) com> writes:

Quote:
1) This is a text field and we input numbers but they must be 4 digits
eg 0412 or 1014. I want a message or warning if anything other than 4
digits is entered
Validate by calculation: length( text ) = 4

Quote:
2) I have a date field and in the validate section I can only find
"validate for 4 digit year". I just want to make sure there is a valid
date eg 12/11/2009 or 05/10/14. (Australia uses dd/mm/yy or dd/mm/
yyyy)
FileMaker does this for you and will not accept other than valid date data.

Jens

--
FileMaker Konferenz in Zürich Mai 2010
http://filemaker-konferenz.com (german)

Reply With Quote
  #3  
Old   
Ursus
 
Posts: n/a

Default Re: How do I validate these fields - 10-03-2009 , 02:08 PM



"Jens Teich" <spamtrap (AT) jensteich (DOT) de> schreef in bericht
news:m24oqgr1dm.fsf (AT) jensteich (DOT) de...
Quote:
davepres <davidpreswick (AT) gmail (DOT) com> writes:

1) This is a text field and we input numbers but they must be 4 digits
eg 0412 or 1014. I want a message or warning if anything other than 4
digits is entered

Validate by calculation: length( text ) = 4
and make it numbers only

Quote:
2) I have a date field and in the validate section I can only find
"validate for 4 digit year". I just want to make sure there is a valid
date eg 12/11/2009 or 05/10/14. (Australia uses dd/mm/yy or dd/mm/
yyyy)

FileMaker does this for you and will not accept other than valid date
data.

Jens

--
FileMaker Konferenz in Zürich Mai 2010
http://filemaker-konferenz.com (german)


--
Keep well / Hou je goed

Ursus

Reply With Quote
  #4  
Old   
davepres
 
Posts: n/a

Default Re: How do I validate these fields - 10-04-2009 , 04:01 AM



Thanks Ursus

Both your answers are right but I still have a problem. These fields
are in a portal and I am updating existing records. Although I have
put the Length validation , it only alerts me if I click outside the
portal - it alows me to put in the data with no warning at all.

David


On Oct 4, 6:08*am, "Ursus" <ursus.k... (AT) ziggo (DOT) nl> wrote:
Quote:
"Jens Teich" <spamt... (AT) jensteich (DOT) de> schreef in berichtnews:m24oqgr1dm.fsf (AT) jensteich (DOT) de...

davepres <davidpresw... (AT) gmail (DOT) com> writes:

1) This is a text field and we input numbers but they must be 4 digits
eg 0412 or 1014. I want a message or warning if anything other than 4
digits is entered

Validate by calculation: length( text ) = 4

and make it numbers only



2) I have a date field and in the validate section I can only find
"validate for 4 digit year". I just want to make sure there is a valid
date eg 12/11/2009 or 05/10/14. (Australia uses dd/mm/yy or dd/mm/
yyyy)

FileMaker does this for you and will not accept other than valid date
data.

Jens

--
FileMaker Konferenz in Zürich Mai 2010
http://filemaker-konferenz.com(german)

--
Keep well / Hou je goed

Ursus

Reply With Quote
  #5  
Old   
Ursus
 
Posts: n/a

Default Re: How do I validate these fields - 10-04-2009 , 10:52 AM



Well that is to be expected. Filemaker normally only validates what you have
entered when the record is commited. This is the moment you click outside
the portal. On its own FMP has no way to know what you are entering and if
it is valid while you are entering data. You might start correct, but only
make a mistake on the last digit you enter. It is like calculations, they
also only update on commit record.

Since you have FMP10 you can built a field trigger. In this way a script is
run every time you press a keyboard-key when you are inside the specified
field. The script must then do the validation for you. Make those
validations as short as you can. You can easily see that a script with 100
lines of code, that fires with every key, will slow down your solution
intolerably.

Keep well / Hou je goed

Ursus
"davepres" <davidpreswick (AT) gmail (DOT) com> schreef in bericht
news:41bdfb00-7e86-43c2-9105-7f339f25a4c5 (AT) m7g2000prd (DOT) googlegroups.com...
Thanks Ursus

Both your answers are right but I still have a problem. These fields
are in a portal and I am updating existing records. Although I have
put the Length validation , it only alerts me if I click outside the
portal - it alows me to put in the data with no warning at all.

David


On Oct 4, 6:08 am, "Ursus" <ursus.k... (AT) ziggo (DOT) nl> wrote:
Quote:
"Jens Teich" <spamt... (AT) jensteich (DOT) de> schreef in
berichtnews:m24oqgr1dm.fsf (AT) jensteich (DOT) de...

davepres <davidpresw... (AT) gmail (DOT) com> writes:

1) This is a text field and we input numbers but they must be 4 digits
eg 0412 or 1014. I want a message or warning if anything other than 4
digits is entered

Validate by calculation: length( text ) = 4

and make it numbers only



2) I have a date field and in the validate section I can only find
"validate for 4 digit year". I just want to make sure there is a valid
date eg 12/11/2009 or 05/10/14. (Australia uses dd/mm/yy or dd/mm/
yyyy)

FileMaker does this for you and will not accept other than valid date
data.

Jens

--
FileMaker Konferenz in Zürich Mai 2010
http://filemaker-konferenz.com(german)

--
Keep well / Hou je goed

Ursus

Reply With Quote
  #6  
Old   
davepres
 
Posts: n/a

Default Re: How do I validate these fields - 10-05-2009 , 12:51 AM



Thanks Ursus,

All vey clear now. Much appreciated.

David

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.