Jump to content
Server Maintenance This Week. ×

Required Fields in CDML


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

Recommended Posts

  • Newbies

I am trying to make a field in CDML on my web page a required field on the web page only. The field is not required (via validation) in the FMpro 4.1 DB because I do not want it filled when a new record is created. The field in question is a password field. I do want the user on the Web to fill in this field and not leave it blank on an Web Page with an EDIT form action. I know in HTML you can make form fields required but I do not know how to do this in CDML. I would be eternally grateful if someone could show me how to make the following field required on the web:

<INPUT TYPE = text NAME=password VALUE="" SIZE=9>

Link to comment
Share on other sites

As far as I am aware, when you are using a form action which has designated action="FMPro", whenever you specify a field-name on the format file, the respective field must exist in the -db/-layout which is designated in that action and that field will be filled with the definitions made on the format file, whether "hidden" or "text" or other.

Peace

Keith M. Davie

Link to comment
Share on other sites

  • 1 month later...

From what I understand of your question, you want to "validate" a field to make sure it is not empty, but only when entered through the web. Correct?

OK, AFAIK and IMHO you cannot use FileMaker's field options validation to do this. However through some sneaky cdml programming you can get the same *functionality* as validation through the web interface. In fact it is quite easy. You don't need scripts or Java or anything that you don't already have.

On the custom format file *after* the form that creates the record, put an [FMP-If: password .eq.][FMP-Else][/FMP-If]... note here that the condition is "if the password field is equal to nothing."

If the password is empty, the statement will return the first set of html: give them a message that says "You gots to type a password" and give them the form again to type their password. Specify this same html page as the -format file so if they try to enter a blank password again they keep getting the same message. In effect the password field is validated, because they cannot pass this point unless they type something, but you are not using FMP's validation functions.

The [else] part should have whatever format file you want them to see if their password is entered correctly.

Link to comment
Share on other sites

This topic is 8653 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.