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.

Need script for autoenter text when field is left empty.

Featured Replies

I need to format a field that will autoenter a small text (PC) if the user doesn't insert a number. I can write small scripts and follow instructions on those that aren't too complicated.

Let we have field A and field B. And you want that field B will be ="PC" if field A is empty? Or no.

If such you can make field B calculation field or AutoEnterCalculated. If not please tell in example.

Edited by Guest

I get very uneasy feelings when putting text into number fields. I know in vs. 7, text APPEARS to be ignored in number calculations. But it still throws off Counts and Averages and may come back to bite you. And if you use boolean in any of your number calculations, text is an Integer and can mess your calc up by producing true (or 1). Also, I have no idea how vs. 4 handles numbers. I would think through carefully whether this is worth mixing your numbers with text.

It might be wiser simply to display a calculation over the top of the field. You would leave your number field alone then create a calculation (text, unstored) with:

If( IsEmpty( num ) , "PC", "" )

Set this calculation to not allow entry in Browse (in Field Behavior) and set it's fill and pen patterns to transparent. Select your number field and Arrange > Send to Back. Then select both fields (by holding down shift), then Arrange > Set Alignment > Center To Center. :D

LaRetta

  • Author

I want PC to be entered into the field if it is left blank. I have a sort of fix, I've got it where it puts it in there when the person prints if they have left the field empty. I would like it to put it in there when they tab out of the field if they have left it blank. I do not know if this is possible.

It will work okay the way I have it, but I would prefer it if it were simply automatic without anyone thinking about it. This is not a number field. It is used for a number but is often left blank and is not used in any calculations.

Look attachment. Try to change First field, or left blank, or create new record.

Don't give up so soon "trible a"!!! Develope your template in 6.0

and give it a whirl with this:

ftp://ftp.volftp.mondadori.com/pub/mac/data_man/filemaker/fmpreverter.sit

But I need to caution, that files tweaked this way are unstable, but for inspecting and learning a certain technique it just fits the bill!!

--sd

Howdy, sis! I would use a calc field as LaRetta suggests except I may not stack them and I'd set it equal to "PC" if field1 were empty or equal to field1 if not empty. Or, you could just set "PC" as the default value and let the user change it to something else if they have a value. Everyone's different, though, eh? So, go w/whatever works best for you.

--ST

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.