2 Replies Latest reply on Jan 20, 2010 1:52 PM by ProZachJ

    CWP w/ PHP Webform

    ProZachJ

      Title

      CWP w/ PHP Webform

      Your post

      FMS 10 MS SMB 2003

      Filemaker installed PHP

       

      I have used the PHP site assistant and alot of deft copy and pasting :smileyhappy: to create a webform whereby a visitor to my website can submit their information into our "prospects" database.  In the database a few fields have the "required value" box checked under validation so that the form will return an error if someone doesn't provide their name or other required information. The problem is that the same error message is returned no matter which field in the webform was incorrect. Does anyone know how to make this a "smarter" form that could tell the user which field they missed. Possibly placing red text over the specific field rather than a generic message at the top of the form. Also It would be nice if the  fields that did validate kept their values rather than requiring the user to re-input the entire form.

        • 1. Re: CWP w/ PHP Webform
          littledog
            

          Hi,

          I have make such option via calculation field on FileMaker reflecting to the web via PHP.

          Example: Fields A and B cannot be empty

          Field A

          Field B 

          Field C

          Field D

           

          CalcField = Case(is Empty(Field A); "TextA; is Empty(Field B); "TextB";"")

           

          And don't use field validation (not Is empty) for fields.

          • 2. Re: CWP w/ PHP Webform
            ProZachJ
              

            Thats a great idea! Can you give me an Idea of what the php looks like to display that field?

             

            However, looking into the Filemaker PHP api at the file validation.php it looks like there is some functionality to add the ability to report what field validation failed on...I just don't know enough about php to desipher how to enable it.