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.

Featured Replies

HELLO! Can you format selected text using a script?

For example I have a field called [note], I would like user to be able to type in the field and have the options to format selected text to...

- bold

- italic

- color change

- larger/smaller font size

I would have buttons by field for user to call on.

Any help or suggestions? THANKS!!!!

See also:

http://fmforums.com/forum/showtopic.php?tid/198604/post/305425/#305425

  • Author

Fitch; Thanks for the link, good source!

Comment; Thank you for the code! I got it to work... almost. The script changes the ALL the text to red vrs only the SELECTED text.

I think the issue is in the

[insert Calculated Result (TextColor ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; RGB ( 240 ; 0 ; 0 ) ) ]

Have I missed something?

Make sure the option "Select entire contents" is unchecked.

  • Author

Yep, unchecked... still no go. I'm sure it is something simple I have missed like this tho. Humm.

I don't know. Does this work for you?

Bold.zip

  • Author

It works as a simple button, but I can not get it to work in the script.

I have attached a file to show problem, the script is a mess! Any help to clean up would be greatly appreciated. Thank you so much for your help.

text_formatter.fp7.zip

Deselect the Option to Select Field Contents in the script step Insert Calculated Result

Edited by Guest

Make sure the option "Select entire contents" is unchecked.

Yep, unchecked...

Check again.

  • Author

Oops, I checked the field behavior, not the script option, sorry.

By the way, anyone know how I can TextFormatRemove in the script?

The problem with using TextFormatRemove() in this manner is that when you insert plain text into a field, it inherits the formatting of the text being overwritten (which sort of makes sense). This was discussed previously here:

http://fmforums.com/forum/showtopic.php?tid/173852/

Create an account or sign in to comment

Important Information

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

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.