Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8183 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello all,

I'm brand new to scripts, have only written one simple one so far. But, that said, I need to create one to do the following, and I don't know where to begin.

I have two fields: zipcode and postalcode

If a US person enters a zipcode, they should be locked out of entering any information in postalcode.

The reverse is also true, if someone enters something in postalcode, they should be locked out of zipcode.

However, if they delete their entry in one, they should be allowed into the other field again.

How can I do this??

Thanks!

-Lynn

Posted

Hello, again, Lynn!

It sounds like you're having a blast with FileMaker. This forum (FMForums) is absolutely the greatest for getting ideas about making FMP work for you. I find it better than books... except, maybe a 'select' few.

Anyways... after I 'posted' the 'auto-entry' address ideas in response to your earlier post, I had many direct requests for more information. I decided to create a sample file to show how my ideas functioned. My sample includes a single 'Postal Code' field that can be used for both Canadian and USA postal codes. It is setup to create the appropriate labels based on the data entered.

If you would like to take a look, tear it apart, etc... it is unlocked. Do what you want with it.

You can e-mail me directly at: [email protected]. If you are uncomfortable using your private e-mail address, goto Hotmail.com and setup a temporary e-mail account. I will understand.

Thanx,

Bob Kundinger

Posted

You can do this with field validation. For example:

Postcode should be validated by IsEmpty(ZipCode), and display a message that "You can't enter a Postcode until you clear the Zipcode field"

ZipCode should be validated by IsEmpty(Postcode), and display a message that "You can't enter a ZipCode until you clear the Postcode field"

You might also want to add some other validations, based on the known length of postcodes etc.

Posted

An easier way, if it is feasible for you, would be to condense ZIP code and Postal code into one field. I'm assuming that if they are US, then they would need have a ZIP Code and if not, its a postal code, right? WEll, you could just have one field, with, instead of a label, a calculation set to look like a label, as follows:

If(Country="USA", "ZIP Code", "Postal Code")

then, set up the validation on the ZIP Postal code to differ, depending upon the value of country, with an if statement. Does that make sense? I like it this way on my layouts because A) it gives the user the illusion that you are contextually changing the form, based on their input, and B) It prevents them from entering where they shouldn't. Another good use for this is in the State/Province field.

This topic is 8183 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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