sbutler Posted January 3, 2005 Posted January 3, 2005 This should be a quickie... If a user selects a choice from a value list, how can I trigger a script to run based on the user's choice? Much thanks! -Scott
Søren Dyhr Posted January 3, 2005 Posted January 3, 2005 This is considered to all right in some operatingsystems guidelines for Human User interface: http://www.filemakerpros.com/FieldExit.zip But macusers should at least be warned off and thier actions should where ever it's posible include "Forgiveness". This is why I made this: http://www.fmforums.com/threads/showflat...5/o/all/fpart/1 --sd
The Mad Jammer Posted January 3, 2005 Posted January 3, 2005 You must have a separate button to run the script. If you attach a script to a pop-up list or any datafield the first thing that happens when you click on it is that the script is executed. This precludes the possiblity of selecting a value first and then executing the script associated with the selected value. What you can do is have the script button execute a script that interrogates the contents of the datafield and then perform a subscript based on the value of the contents. i.e. let's say you have a datafield called Field1 that is formatted as radio buttons and the value list connected to the field has values ONE, TWO, THREE, FOUR. You can change the contents of the datafield by clicking on one of the values that in the field. When you click on the script button it will execute a script, lets call it Fred. Fred looks like this If (Field1 = "ONE") Perform Script(sub-scripts,"Show One") Else If (Field1 = "TWO") Perform Script(Sub-scripts,"Show Two") Else If (Field1 = "THREE") Perform(sub-scripts,"Show Three") Else If (Field1 = "FOUR") Perform Script(subscripts,"Show Four") Else Show Message ("Nothing Selected") End if End if End if End if Each subscript would do whatever you wanted it to do for the associated value in Field1. If you attach the script to the datafield you will never be able to change the value in the datafield before executing the script. The Mad Jammer
Ugo DI LUCA Posted January 3, 2005 Posted January 3, 2005 You may want to play with some plug-ins now with version 7, or use some other ways... Here's an alternative using a repeating field to mimic a value list and JM. Osborne Visibility technique. It has a 250+ Value list which obviously isn't a reasonable solution, but working with a 10-15 items would be easy I'd think. ClickAndGo.zip
-Queue- Posted January 11, 2005 Posted January 11, 2005 You don't need a separate button. The first part of your script merely needs to go to the field and pause. On Windows, make the field a menu and attach a script like Allow User Abort [Off] Go to Field [yourfield] Pause/Resume Script [0] If [yourfield = 1] Perform Script [One] Else If ... End If For Mac, the solution is similar, but requires using a list, a loop and an Exit Loop If [not IsEmpty(yourfield)] step.
Recommended Posts
This topic is 7623 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 accountSign in
Already have an account? Sign in here.
Sign In Now