1 Reply Latest reply on Sep 5, 2010 1:34 PM by MartinBrändle

    FMS10 CWP - Need to add validation to search page

    MarkCarollo

      Title

      FMS10 CWP - Need to add validation to search page

      Your post

      Using CWP in PHP, I have a search page with two fields that search using AND logic.  When I click submit on the form without anything in either field, it returns all records.

      How do I add some sort of validation?  Even requiring a single character would work.  I have the fields set to use the "equals" option for both fields.  Any suggestions?

      The forms were created using the PHP site assiatnt in FMS9, but we have since upgarded to FMS10.

        • 1. Re: FMS10 CWP - Need to add validation to search page
          MartinBrändle

          There are two options:

          - use a JavaScript function to check the input (with  onsubmit="return your_validation_function(this)" in your form tag). There are many examples in the Web how to do this.

          - submit the values to an intermediate table by opening a new record, read the created record and validate with PHP, and then perform the search only if validated values are ok. This is a the safer option since everything is carried out server-side.