Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

date masks in a edit field on a layout?

Featured Replies

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__

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.

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 )

  • Author

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__

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

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...

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

Lee

smirk.gif

  • Author

thanks to all of you for the useful information.

need to ponder the options a little.

sincerely,

J__

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...

  • Author

thanks for the response Grant.

I appreciate it and may try it at some point.

sincerely,

J__

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.