Robbydobbs Posted March 20, 2003 Posted March 20, 2003 There is a way to select a value from a value list and activate a script from the selection. My problem is that currently this is not working for me. I have done this before but for some reason my value list is not working correctly. The [text field] "payment_type" is linked to the [valuelist] "payment_type" and I have specified the field to perform my script. In the [valuelist] "payment_type" is a listing of values: CASH, DEBIT, VISA, MASTERCARD, DISCOVER and OTHER. I have two other fields that are involved in this script. [number_field] "payment" and [number_field] "credit_card" Below is how I have my script written. Go to Field "payment_type" if ["payment_type = "VISA"] Set Field [ Credit Card, Payment * .03] Else if ["payment_type = "CASH"] Set Field [ Credit Card, 0] Else if ["payment_type = "DEBIT"] Set Field [ Credit Card, 0] Else if ["payment_type = "AMEX"] Set Field [ Credit Card, Payment * .03] End If End If End If End If When I click on the [text_field] payment_type I get a message "This field is Not Modifiable". After I click on the OK, then the Value List shows up. I select the name "CASH" but the script does not activate. What am I doing wrong?
danjacoby Posted March 20, 2003 Posted March 20, 2003 First of all, let's clean up the script. Instead of all the "if" statements, try this: SetField(CreditCard) Case(payment_type="VISA", Payment * .03, payment_type="CASH", 0, payment_type="DEBIT", 0, payment_type="AMEX", Payment * .03) Now you only have one SetField command. My guess is that the error message you get has to do with the script saying GoToField. I'd add a Pause step after GoToField, then attach the script to the field in the Format:Button menu. That way, you'll get the popup list for the field, select the value you want, then you'll have to continue the script, but it'll work.
Robbydobbs Posted March 20, 2003 Author Posted March 20, 2003 Thanks Dan, it worked perfectly. I appreciate you letting me know how to clean up my script.
danjacoby Posted March 21, 2003 Posted March 21, 2003 That's why I get the big bucks. Um ... you all can stop laughing now.
Recommended Posts
This topic is 7920 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