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.

Client Side Form Validation

Featured Replies

I am trying to use Javascript to validate a form, and stop the user form submitting an invalidated form. The problem is that the JS validation uses the "name" parameter and requires it begin with a letter. Filemaker seems to require that the "name" be a number. This is an example of the input code in the editrecord.php file:

"<?php echo $record->getField('agency_department', 0) ;?>">

This shows on the live page as:

So "name" is 1. The JS validation (and w3 standards) want "name" to be a letter, not a number. We tried changing the name to a letter which resulted in no data going into filemaker.

Is it possible to make the name tags start with a letter or is there another client-side validation that can be used with filemaker php pages? If the name tag is a number, javascript validation won't work.

According to the World Wide Web Consortium: http://www.w3.org

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

If this cannot be done, is the only option to use FileMaker pro's validation option field by field? Or is there another way I am not aware of?

Any help would be appreciated, as usual!

You're bumping up on one of the many reasons I loath the Site Assistant. I've never tried it with the name field but you can hack JavaScript's document.getElementById() function to access an element with an integer by casting it as a string.




function getNumericID(){

	var intVal = 1;

	var elem = document.getElementById(intVal + "");

	alert("name = " + elem.name + "nid = " + elem.id + "nvalue = " + elem.value);

	return;

}











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.