brian rich Posted November 24, 2005 Posted November 24, 2005 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
Martin Brändle Posted November 26, 2005 Posted November 26, 2005 Upon display of the XML result set tree by , do you get any hint on which field produces the error?
brian rich Posted November 28, 2005 Author Posted November 28, 2005 (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
Martin Brändle Posted November 28, 2005 Posted November 28, 2005 Hmm. I'm afraid the only solution is a feature request to FMI.
MetaSys Software Posted December 28, 2005 Posted December 28, 2005 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
Martin Brändle Posted December 29, 2005 Posted December 29, 2005 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.
Martin Brändle Posted December 29, 2005 Posted December 29, 2005 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.
brianrich Posted January 5, 2006 Posted January 5, 2006 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
Recommended Posts
This topic is 6896 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 accountSign in
Already have an account? Sign in here.
Sign In Now