Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5529 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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;

}











This topic is 5529 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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