AnnaC Posted May 22, 2003 Posted May 22, 2003 I am very new to this so please bear with me! I am trying to create a script that will function in different ways depending on the selection made in a field containing radio buttons. I have a field 'Consent' in which you can select either Yes or No. What i would like to do is if 'yes' is selected have the script take the user to a different layout within the database. If 'no' is selected i would like it to remian on the same layout and display a message. Is this possible and if so how? I know this is probably simple but i am new to scripting! Thankyou in anticipation
Lee Smith Posted May 22, 2003 Posted May 22, 2003 Hi Anna, Check out the Show Message script step. For an example of how this can work, Show Message at: http://www.fmfiles.com/tnt8.html Lee
Pupiweb Posted May 22, 2003 Posted May 22, 2003 Hi Anna try with If (RadioField ="Yes") Go to Layout [Other] Else Show Message (You haven't chosen Yes ...) End If You might also add an If () at the beginning to check for an empty RadioField, should this imply a different action
AnnaC Posted May 22, 2003 Author Posted May 22, 2003 Hi, Thankyou for your help. I have tried the above but i still canot get the script to run. Is it true that i have to have buttons to attach the script to or can it run simply from the 'Consent' Text field i have formatted for radio buttons? I know this may sound stupid but i haven't ever worked with Filemaker before. Thanks, Anna
kenneth2k1 Posted May 22, 2003 Posted May 22, 2003 Hi: you can place a transparent button over each selection (yes and no, in this case) and assign it a script. For example, you would have 2 scripts - I'll call them YesButton and NoButton. YesButton script: Set Field [radio button field, "Yes"] Go to Layout [whatever] --or whatever you want it to do-- NoButton script: Set Field [radio button field, "No"] Show Message [whatever] --or whatever you want it to do-- place these buttons over the yes and no in the radio button field and set them to transparent. oh yea, don't forget to uncheck "allow entry into field" option. Ken
AnnaC Posted May 23, 2003 Author Posted May 23, 2003 Thankyou so much! It works! Just a question though for future reference, is it essential that when you want to run a script it be attached to a button? Thanks again! Anna
kenneth2k1 Posted May 23, 2003 Posted May 23, 2003 There are plug-ins that allow for script execution upon exiting a field, but this is not native to FM.
AnnaC Posted May 23, 2003 Author Posted May 23, 2003 Thank you! I'm sure i will be calling on your help again in the near future! Anna
Recommended Posts
This topic is 7859 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