Jump to content
Sign in to follow this  
J__

date masks in a edit field on a layout?

Recommended Posts

Hi,

I would like to display a field which contains something like [ / / ]

for a date. so then all i have to do is type 102404 and the date is 10/24/04.

I know I can validate this after the fact and check to see if / / are there, but what about in the field displaing slashes before the user goes in the field?

thanks for your help in advance,

sincererly,

J__

Share this post


Link to post
Share on other sites

Since you are using FMP 7 you might be able to take advantage of the new autoenter calculation feature. One of the things it can do is manipulate data entered into the field.

Share this post


Link to post
Share on other sites

Vaughan is correct. However, your field will have to be a text field, as MMDDYY is not a valid FM date format. You can use an auto-enter calculation with 'Do not replace existing value' deselected. Left( field; 2 ) & "/" & Middle( field; 3; 2 ) & "/" & Right( field; 2 )

Share this post


Link to post
Share on other sites

Thanks guys, I really appreciate it.

I just want a standard / / when you tab into the field.

then be able to type in each section. But it does need to be a date field in the end.

any additional suggestions?

thanks,

Sincerely,

J__

Share this post


Link to post
Share on other sites

I think you're going to need two fields still, due to the format being invalid for a date field.

Share this post


Link to post
Share on other sites

You could auto-enter a (fake) date, like 01/01/01, and allow user-override. At least you've got a date field and the slashes...

Share this post


Link to post
Share on other sites

Why not just put a button next to the field, and use the Insert Current Date Script Step?

Lee

smirk.gif

Share this post


Link to post
Share on other sites

thanks to all of you for the useful information.

need to ponder the options a little.

sincerely,

J__

Share this post


Link to post
Share on other sites

It's a lot to go through to get what you want but here's an idea.

Create a text field for this data without slashes. Add it to a layout and make it editable.. Create another field as a calculation that displays the data with the slashes (that's the Left/Middle/Right equation mentioned earlier). Place this field over your original text field but do not alow entry. Now when people enter this field they will be editing the text field and just type the numbers. When they move on the data is displayed with the slashes.

But if you want to use this data as a date (and, as Queue says, it is the wrong format) you'll need yet another calc field that returns a date to parse it into the right order.. I think that's the Date function...

Share this post


Link to post
Share on other sites

thanks for the response Grant.

I appreciate it and may try it at some point.

sincerely,

J__

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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