One of our customers recently needed a field to be both non-editable and scrollable in FileMaker Go. Here’s his request:
I need to build a system for someone to read a form on an iPad and capture their signature in a container field. The forms are of variable length and will change over time. So I want to put the body of the text into a field for each form for each signature.
Since the form can be very long, the user will need to scroll to read the whole thing. But, when you click into a field, the keyboard pops up on the iPad. Is there away to suppress that?
Well… no. Not with a field. But... yes. With a web viewer.
There’s no way to stop the virtual keyboard from appearing as soon as a user clicks into a field in FileMaker Go. On top of that, the cursor will jump to the end of the text in the field; if you’re trying to present a large amount of text with many paragraphs (such as one of those End-user License Agreements I’m always skimming over), the user will have to scroll back to the top. We need a way to allow the user to scroll through the field contents without actually entering the field. Adjusting the field in Layout mode to prevent entry in Browse mode gets you part of the way there. But if the amount of text exceeds the size of the field, you end up with hidden and inaccessable text, as there’s no way to scroll the field contents if you can’t enter it.
But there’s a simple workaround to create a scrollable, non editable area displaying text field contents. Enter the Swiss Army knife of layout objects: the web viewer. Pages in a web viewer can be scrolled through, and even copied from, without ever invoking the iOS keyboard.
We normally think of the web viewer as a tool to display web pages. But you can also feed a web viewer raw HTML for it to display using a data URI. If the web viewer’s web address starts with “data:text/html,”, whatever HTML follows will be parsed and displayed.
So, don’t use a field to display your form’s text; use a web viewer. To get our field’s contents as HTML, we can use the GetAsCSS() function. Our web viewer’s calcuated web “address” is a simple:
"data:text/html," & GetAsCSS ( formTable::textField )
This is a trick we use both in FileMaker Go and on the desktop in FileMaker Pro when we need to present a “field” that can be scrolled or from which one can copy (meaning we have to allow entry in Browse mode), and where using access privileges to restrict editing isn’t the right solution (if, for example, they can edit the field on other layouts).
Log in or register to download the sample file.
Jay Gonzales
02/10/2012
Great tip. Glad you pointed out that it works in both Pro and Go.
Brian Schick compared this Web Viewer technique with a combined script trigger + proxy calculated field approach, and also came up with a simple Custom Function to modify the Web Viewer background color: http://buzz.beezwax.net/2011/09/06/filemaker-read-only-fields-lighter-smarter-friendlier
alistair campbell
04/13/2013
Great work, I need to try it out on the iPad. Is it possible to to the same for a container field. I want to play videos and audio in filemaker GO without going to another layout??
Log in as a member to comment...
Mike Hampton
12/15/2011
Simple, elegant and funny!
Viewed it from my iPad.