logo

New Response

« Return to the main article

You are replying to:

  1. Lo all, Was interested in moving some of our forms away from only-javascript validation for all the reasons described in the article and posts above. My only worries were 1. I run lots of agents in the WebQuerySave event and 2. I usually lock users out of the form once posted.

    So my final solution needed to address both of these as well as the standard issues of holding already posted data etc...

    Found that the above post does make server-side validation quite manageable.

    My only issue is the amount of hand coding that goes into the WebQuerySave. You have to identify all the fields and how you want to validate them.

    That said here is my contibution. Like I said, I tend to run lots of agents post submit so here is my WebQuerySave.. shows validation followed by agents running. Formula language still so simple to work with.

    @If ( DeleteDocument = "Delete" | ArchiveDocument = "Archive" ; "" ; @Do (

    errors:=""; @If( Title=""; errors:=errors:"Title is required"; "" ); @If( CapabilityFocus1=""; errors:=errors:"Capability is required"; "" ); @If(@Elements(errors)>0; @Do(@SetField("hasErrors"; 1); @SetField("Errors"; errors); @SetField("SaveOptions"; "0")); @Do(@SetField("hasErrors"; 0); @SetField("Errors"; ""); @SetField("SaveOptions"; "1")) );

    @Command([ToolsRunMacro]; "(agent1)") ; @Command([ToolsRunMacro]; "(agent2)") ; @Command([ToolsRunMacro]; "(agent3)")))

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: