12 Replies Latest reply on Oct 26, 2012 10:39 AM by philmodjunk

    Format an address field

    Epa

      Title

      Format an address field

      Post

           I have a field called Table1:Address.  It is used in a portal where a user will type directly into the portal field.  Is there any way to format it so the user will see a pre populated template.  For example, when a user clicks on this field, I want the following to display (or perhaps a validation, which I will create a custom message for?)

           Address 1: "User would type here"

           Address2: "User would type here"

           City: "User would type here"

           State:   "User would type here"        Postal Code: "User would type here"

           Hope this makes sense.  I set up a database using ONLY portals for data entry (like a dashboard), and separate fields for each address line (address 1, address, 2 , city, etc) will take up too much space in the portal).  

           Thanks

        • 1. Re: Format an address field
          philmodjunk

                Put layout text on top of each field: User would type here

               Give each block of layout text this conditional format:

               Not IsEmpty ( YourTable::Address 1 ) // specify a different field for each block of layout text

               Specify that this conditional format change the font size to 100+ to make the text disappear.

          • 2. Re: Format an address field
            EP

                 Let me clarify a bit more. It is only one field.  It's also in a portal row, so the field expands when being typed into, and after committing you can only see the top line, unless you click the field to edit it.  If this doesn't make sense, I will post a screenshot when I get to my computer.

            • 3. Re: Format an address field
              philmodjunk

                   If you can only see the first line, why do you need the portal?

              • 4. Re: Format an address field
                EP

                     Because when you click on the field, you can see the entire field contents when it expands.   I'm designing a solution specific to certain office functions.  I just need users to enter the address properly so that it can be included on an email function that will send the info to users on an ios device.  If the address isn't formatted correctly, the ios user cannot click the address to open maps app and have it auto find the address for navigation.  Fyi: This is the database you have offered advice on in the past  that has nothing but portals (only 1 record).

                • 5. Re: Format an address field
                  Epa

                       Hope this helps.  The address is there when clicked on.  When out of focus, only the top line is displayed (for the sake of keeping my portal rows at a decent height)

                  • 6. Re: Format an address field
                    philmodjunk

                         I see potential data entry problems with your approach, but what I have suggested here should work for your portal. The key is that this text is a layout object, not data in your field and the conditional format hides it from view when you have any data at all in the address field.

                    • 7. Re: Format an address field
                      Epa

                           Maybe I should just go with a validation then that requires the following:

                           Address 1

                           Address 2 (optional)

                           City, Ctate, Zip

                            

                           Is this possible via a calculation?

                      • 8. Re: Format an address field
                        philmodjunk

                             Yes, but it's not how I'd do this. I'd open a modal window when the field is clicked that used separate fields for Address 1, Address 2, City, State, Zip. The field you show here would then just be Address 1, but a tool tip can be used to combine the contents of all address fields so that you can inspect the address without opening the new window.

                        • 9. Re: Format an address field
                          Epa

                               Can you teach me how to pop up a window for address entry? Thanks

                          • 10. Re: Format an address field
                            philmodjunk

                                 What version of FileMaker are you using? FileMaker 12 added some new features that makes this work better.

                                 And what operating system do you use? (Windows systems can require a few more script steps than Macs if the DB is set up to run with maximized windows.)

                            • 11. Re: Format an address field
                              Epa

                                   FMP12

                                   I use Mac and Windows and iOS (but this database might not get used on iOS, havent made that decision yet).

                              • 12. Re: Format an address field
                                philmodjunk

                                     Ok, you'll want to look up the New Window script step in FileMaker Help. You can use that step to open a new window with the "Dialog" style so that the user must close this window before interacting with the original window--which is typical dialog box behavior. You can specify dimensions and a location for this to appear on your screen. You then use go to layout while the focus is still on this new window to select the layout you want to use for entering the address data so you would also design a layout to use with this new window.

                                     In Windows Systems with maximized windows, New Window drops your windows out of the "maximized" state and the current window will resize to its most recently used dimensions the last time it was not maximized. This can create a very unwelcome change in window dimensions. You can't prevent the size change, but you can minimize it by using move/resize window to resize it back out the the size of your monitor screen.

                                     Here's a script I use in the Known Bugs List database that opens a small modal window for entering data:

                                     #This script opens a popup window for logging a new release of the database.
                                     Set Variable [ $VersionID; Value:Max ( AllVersionHistory::VersionID ) + 1 ]
                                     Set Variable [ $PaletteWidth; Value:Let ( width = 650 ; If ( Right ( Get(WindowZoomLevel) ; 1 ) = "*" ; width * 1.3 ; width ) ) ]
                                     Set Variable [ $PaletteHeight; Value:Let ( hgt = 165 ; If ( Right ( Get(WindowZoomLevel) ; 1 ) = "*" ; hgt * 1.3 ; hgt ) ) ]
                                     If [ Abs ( Get ( SystemPlatform ) ) = 2 // this is a windows platform ]
                                            #minimize window resize on windows platforms.
                                            Move/Resize Window [ Name: Get ( FileName ); Current file; Height: Get ( ScreenHeight ); Width: Get ( ScreenWidth ); Top: 0; Left: 0 ]
                                     End If
                                     New Window [ Name: "New Version"; Height: $PaletteHeight; Width: $PaletteWidth; Top: Div ( Get ( ScreenHeight ) - $PaletteHeight ; 2 );
                                                  Left: Div ( Get ( ScreenWidth ) - $PaletteWidth ; 2 );
                                                  Style: Dialog; Close: “Yes”; Minimize: “No”; Maximize: “No”; Zoom Control Area: “No”; Resize: “No” ]
                                     Go to Layout [ “VersionHistory” (VersionHistory) ]
                                     Show/Hide Toolbars [ Lock; Hide ]

                                     Since I use FileMaker Advanced, I've installed a custom menu with the VersionHistory layout that performs a script when the close box on this new window is clicked or if they select Close from the File menu or press the keyboard short cut. It closes the window and then, on windows platforms, returns the windows to maximized.