Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to append to a field

Featured Replies

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

  • Author

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.

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

  • Author

That worked great except now I have the following: ",apple,pear,banana" How do I get rid of the initial comma

Change it to:

Set Field [ textField ; textField & If(not IsEmpty(textField); ", ") & Get ( ScriptParameter) ]

Set Field [ textField; textField & Case ( not IsEmpty ( textField ); ", " ) & Get ( ScriptParameter ) ]

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

  • Author

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.

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.

  • Author

I get the same problem when I use radio boxes.

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; "¶"; ", " )

  • Author

the second field uses the set field to apply the calculation?

  • Author

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.

  • Author

ok it worked. what was messing me up was that funny looking A. What is that? When I got rid of it, it worked great?

  • Author

ok now I dont see the A with the accent on top in this thread. I must be hallucinating.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.