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.

Field Validation with JavaScript

Featured Replies

Folks

It's been talked about in the Forums before, but I never took any notice of it since it'd be a cold day in Queensland... I mean Hell when I'd use any of that new-fangled stuff.

Well, it's snowing.

I've just spent a day f*cking about with validation-by-calculation to work out that *I* cannot get it to work over the web. (I'm specifically working on modifying the Web Security databases to get a better web interface to them.)

What I would like to do is to:

1) validate that a field is not empty before submission

2) validate whether a field can or cannot be empty based on another field.

Hmmm the second item is a clear as mud. Here is the situation: The Web Security database -- specificallyb the Web Users_.fp3 ddatabase can have a special user name "All Users" that controls guest access. If the field "User Name" is "All Users" then a password is not required. If the User Name is anything else (it cannot be empty) then a password is required.

I have a sneeking suspicion that the space in the field name "User Name" is going to cause chaos with the JavaScript. I dunno whether it can be renamed, I'll have to try.

Thanks.

Vaughn,

You consider Javascript to be new fangled? Its been around for quite some time.

Anyway, i know my way around javascript fairly well. if you want any help writing some validation scripts i will be happy to help. I have written many for my Intranet site i am working on.

As for the space in the field names, it could cause a little bit of trouble, but there are ways around it.

also you might want to check out http://www.javascriptcity.com

They have a pretty decent forum and the people are friendly, and i always tend to get answer to questions that i have.

like i said i have quite a few validation scripts already written and would be happy to share them with you if you need them. afterall i have always been a html/javascript programmer first then a database programmer second and you guys in here have helped me through this filemaker thing more times than i can count.

  • Author

DO I consider JS "new-fangled"... I still play black-vinyl records although I do admit that most of them are micro-groove *and* stereo! <grin>

I'll take you up on your offer of help. I'm developing a solution and I'm up to the "I know it can be done but do I want/need to do it?" stage.

Heartfelt thanks.

well just let me know if you decide you want to do it.. i will be glad to walk you through it.. or some of the scripts i already have written may work fine for you.

just let me know..

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.