November 24, 200520 yr I am using CWP with XSLT to add and edit records in a FMP7 database hosted on FMP7 Advanced Server with IIS. In the FMP7 database, I have a number of fields where validation criteria are set up, such as not empty, unique, valid date etc. If the user submits data which will not validate via the web interface, I get and error 500 - as anticipated - but there is no information about which field has failed validation, so I can't tell the user which field to correct. I'm considering using client-side javascript for the obvious things like not null, valid date etc but I can't see how to check for the server based validation items like 'unique'. Can anyone point me in the right direction? TIA Brian
November 26, 200520 yr Upon display of the XML result set tree by , do you get any hint on which field produces the error?
November 28, 200520 yr Author (sorry, had to reregister as forum would not log me in!) Thanks for that suggestion. Below is the response that I get - the actual url posted was attempting to send an invalid date value into a date field on the database. Only the error code is returned - there is no record information returned at all. I assume that because the validation fails, no record information can be generated. This is the problem I am wrestling with. Thanks Brian
December 28, 200520 yr Hi, Erroe code 504 is for unique constraint... In our web applications that we have developed so far, depending on the number of validations and considering the volume of data, we have implemented three different strategies for unique constraint.. 1. check for 504 error code 2. validate for all possible validations using javascript and then handle the remaining validations using error codes 3. fire a query to search for the data being entered, to check whether such record exists and check for the found set to display appropriate message.. I hope this helps.. Regards, MetaSys
December 29, 200520 yr This answers the original question only in part. There is no hint by the WPE when it returns the error code which field has failed the validation. Your solution runs then into trouble when you have multiple validation fields in the same table. The best would be if the field name for the field that failed were returned in the XML tree above. That's why I suggested a feature request to FMI.
December 29, 200520 yr Just submitted this feature request: Improve the returned XML tree as follows: By this way, the field that fails can be easily extracted from the XML tree.
January 5, 200620 yr Thanks for submitting the feature request; I assume that the returned XML tree would contain a field-definition element for every field that fails validation. I have adopted a similar strategy to Metasys in trying to use javascript to validate as much of the form as possible prior to submission. I'm just frustrated that having to create and manage javascript within the XSTL is an extra dimension of complexity, and the development time is escalating enormously whilst I try and construct suitable javascript routines that work in all browsers. If anyone has a set of browser-neutral javascript routines that can build a date menu from pop-ups that only allows valid dates, can be set up from existing date fields in the Filemaker database, can manage more than one date field per form, and can be rendered from an XSLT page, I'd love to get my hands on them. Brian
Create an account or sign in to comment