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

My client's users are entering invalid website URL's into a FMP field. I'd like a custom function which will at least test whether the URL is well formed, start with either http:// or https:// and end with a valid .com or similar.

I've checked Brian Dunning's site and haven't found what I'm looking for. Any ideas?

With appreciation

Here is a list of common TLD http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains

A pattern count to grab the last few characters match a this list of TLD

in addition to the starting characters should be pretty easy to validate.

But some websites end in .com.au for example. So that would have to be considered as well.

Is internet available where data is being input? If so, you may want to try fetching the header to the page only (not content); this should be quite fast. It appears you're on Mac, in which case this could be achieve with shell command cURL.

i.e. curl http://www.google.com --head --output outputfile

I'm running on a PC, but cURL is free for it and works equally well. The first line of the cURL results will show status: e.g. HTTP/1.1 200 OK or anything else for can't load (e.g. first line reads HTTP/1.1 403 Forbidden) or cURL may return could not resolve host. If the cURL output is appended to a file, it could be processed later by Filemaker, or Filemaker could just wait until the cURL output file exists, then re-import it.

There are a good deal of URL validators in PHP, javascript, etc on the web which can be altered to work within FM's webviewer. e.g. in address line of your web browser, enter:

javascript:var regexp = /(ftp|http|https):(w+:{0,1}w*@)?(S+)(:[0-9]+)?(/|/([w#!:.?+=&%@!-/]))?/;document.content=regexp.test("http://www.google.com");

(above validates https://www.google.com) -- it returns 'true' or 'false'. This function can be used in FM using webviewer allowing a regular expression match without a plugin (webviewer contents can then be read back into a field) or it can be translated into an FM custom function.

This isn't as definitive as going out to fetch page of course. Webviewer can also be used to load page; it can even get headers only with HTTP requests.

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.