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

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

Recommended Posts

Posted

Hello,

In my database, there's a drop-down menu where the user can select various options--say, A, B, C, or D. I am trying to write a script that puts an X in a different edit field/checkbox IF the user selects B, C, or D (not A) in the drop-down.

Every time I write the script, it puts an X in the box regardless of what I've chosen (even if it's A). My script is simple:

If [Field name="B" or "C" or "D"]

Set Field [Field name; "X"]

End If

Do I have to do something different when working with value lists? Is there a special function I should be using?

Thank you!

Posted

Look into patternCount.

PatternCount( string1; string2)

counts how many times string2 occurs in string1

You probably want

if patternCount( "BCD"; yourField )

Posted

Why not make the field an auto-enter calculation

If ( Field name = "A"; "";"X" )

with the Do not replace existing value box unchecked so that when the dropdown field value is selected the X is entered automatically

Posted

Thanks, everyone...I'd like to do what you suggest, efen, but even with the auto-enter calculation I can't get it to put the X in the box at the correct time. I'd like it to put the X in the "subscription" box whenever any item *except* "entry fee" is selected from the "payment description" pop-up menu. I think I'm confused about how the calculation and script interact... I attached the file, in case you have a minute to look at it. Thank you!!!

contest.fp7.zip

Posted (edited)

Yes, thank you!

Clearly I need to read more about FMP functions and practice my script-writing.

Thanks for taking the time!

Edited by Guest

This topic is 5281 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.