Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi,

I am new to all this. I want to have buttons that when pressed would add to a field. For example I would have five buttons:apple,orange,kiwi,strawberry, banana and pear. When I press the apple, banana and pear buttons I want the field (chosenfruit) to show all three items but not the others.

Thanks in advance for your help

John C

Posted

Addendum when I attach the scripts to buttons now and sequentially they replace the current field data. I want them to append to that data. For example when I sequentially press apple, banana, pear I get pear only. My scripts have two steps: go to field and insert text.

Posted

Hi John,

I would suggest using Set Field [] instead of insert text. I am unsure whether you are adding the next fruit in a multiline or a comma style list. I will give you both. The script could be the same for every button. The button could have a script parameter attached to it, just specifying the fruit. Then script would be:

Set Field [ textField ; textField & ¶ & Get ( ScriptParameter)

This would add each fruit in a multi line (list). To have it listed as apple, pear, cherry, change the ¶ to ", "

LaRetta

Posted (edited)

Set field [ substitute ( list ( field ; Get ( ScriptParameter )) ; ¶ ; "," ) would also work if you don't have multiline entries.

But did you consider using a simple value list with checkboxes ?

Edited by Guest
Posted

Ok all of that worked great and thank you all you gurus. I now agree I would be better served with checkboxes and a value list. When I try that the fruits are on different lines with paragraphs in between rather than on the same line with commas in between (but not at the front lol) I cant find a way to do that.

Posted

You can't with checkboxes. Each checked item represents a "value" that is in the field, that value being defined by a new line (carriage return). You could use an auto-enter calculation to substitute the carriage returns with commas but then the checkboxes will untick themselves.

You'll need to compromise either with a second field for display or by switching to a method other than the checkboxes.

Posted

check boxes, radio buttons, drop down lists... they all use "values" from a value list. Values within a field are separated by carriage returns therefore any technique which relies on values won't yield the desired results.

You could use two fields, one for entry using the checkbox method, and one for display showing the comma separated values. This second, display field would have a fairly simple calculation:

Substitute ( textField; "¶"; ", " )

Posted

I have tried this two ways set field and insert calculated result. fruitfield1 has the data from the checkbox value list with the paragraphs and fruitfield2 attempts to take the info from one and substitute the paragraphs for commas using the substitute command. I have yet to see any commas just my data from fruitfield1 in the same format.

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