Skip 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.

Set cursor location in a field?

Featured Replies

Does anyone know a way for a script to set the cursor position within a field to a specific location? What I need to do is have a button that adds a note with attribution to the top of a notes field. So, if the field says "8/23/05 foo: this is weird", I need the script to add "8/23/05 bar: a new note" followed by a couple of line feeds.

It's easy to add the attribution and line feeds to the top of the field, but how do I then set the cursor to the end of the newly-in serted attribution so that someone can start typing there?

Thanks in advance.

A better idea is to use a global field for data entry, then set the non-modifiable notes field to

globalField & "¶¶" & notesField.

This way notesField cannot be modified accidentally.

  • Author

Well, I started out doing something like that, but that approach introduces a level of indirection (having to enter data into a different field and/or layout than where it will be viewed), and I have found that users can find that counterintuitive and disorienting, or, at the least, an annoying extra step.

For that reason, I think doing it in the same field is the *better* solution, but if there's no way to set the cursor position (which I would have thought would be simple), then it's not going to be a *workable* one.

I agree with Queue (which BTW is generally the smart thing to do). Your objection is easily solved by designing the layout with a clearly marked "draft area" and a "Add to Notes" button.

That said, examine the Set Selection script step.

  • Author

Sigh.

Well, I can't say I'm surprised; this is classic Filemaker. I've been working with the program long enough to know when to say "uncle" and do the workaround, so I'll just make the "Add Note" button bring up a layout with the global field and have a "Done" button that will update the Notes field.

By the way, I tried the Set Selection command, setting the start and end to be the same character right after the colon that designates the end of the "header." It didn't quite work, but I didn't fiddle with it, I just tried it once.

Thanks for your help, folks!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.